“When James says that faith alone does not justify, faith here refers to mere intellectual assent. For instance, demons affirm monotheism, but such “faith” is not wholehearted and glad-hearted assent that leads demons to embrace Jesus Christ as Lord and Savior. Instead, the faith of demons is theologically orthodox, but leads them to shudder because they fear judgment (James 2:19). The faith that saves, according to Paul, embraces Jesus Christ as Savior and Lord, placing one’s life entirely in his hands. James criticizes a “faith” that notionally concurs with the gospel but does not grip the whole person. In other words, James does not disagree with Paul’s contention that faith alone justifies, but he defines carefully the kind of faith that justifies. The faith that truly justifies can never be separated from works. Works will inevitably flow as the fruit of such faith. Faith that merely accepts doctrines intellectually but does not lead to a transformed life is “dead” (James 2:17, 26) and “useless” (James 2:20). Such faith does not “profit” (ophelos [James 2:14, 16 RSV]) in the sense that it does not spare one from judgment on the last day. Those who have dead and barren faith will not escape judgment. True faith is demonstrated by works (James 2:18). James does not deny that faith alone saves, but it is faith that produces (synergew) works and is completed (teleiow) by works (James 2:22). The faith that saves is living, active, and dynamic. It must produce works, just as compassion for the poor inevitably means that one cares practically for their physical needs (James 2:15-16)....The foregoing comments, of course, need qualification. As I argued above, in some contexts Paul also emphasizes that good works are the fruit of faith and are needed for justification (e.g., Rom. 2:13; 4:17-22). The purpose of James as a whole, as is evident from this entire discussion, is to emphasize that good works are necessary for salvation. His letter apparently responds to a situation where moral laxity was countenanced. Nevertheless, James should not be interpreted to teach that believers can gain salvation on the basis of good works. Righteous deeds are the fruit of faith. James recognizes that all believers sin in numerous ways (James 3:2), and that even one sin makes a lawbreaker of the one who commits it (James 2:10-11). Being sinners, humans lack the capacity to do the works required to merit justification. They are saved by the grace of God, for in his goodness and generosity he granted believers new life (James 1:18). Even faith is a gift of God, for God chose some to “be rich in faith and heirs of the kingdom” (James 2:5). What James hammers home is that such faith must always manifest itself in good works if it is genuine faith, but such good works are a far cry from perfection, as James 3:2 clarifies.”
-Thomas R. Schreiner, New Testament Theology: Magnifying God in Christ (Grand Rapids, MI: Baker Academic, 2007), pp.603-605.
(HT: Saint and Sinner)
For more detail, check out Excursus 2 in Dan McCartney's commentary on James.
(HT: Steve Hays)