Wisdom is necessary in dealing with trials and afflictions; it may be obtained through prayer to God, vs. 5a. With this divine wisdom the readers will be above to endure suffering with patience and to escape ultimate danger and temptation . . . It is likely that James had such sources of “wisdom” [i.e., books] in mind when he advises his readers to strive after the true wisdom that comes only through prayer
Bo Reicke, The Epistles of Peter, James, and Jude (Anchor Bible 37; Garden City: Doubleday, 1964), 14, square bracket added by me.