It's often thought that Paul addressed the problem of legalism, James the problem of license. Paul corrected those who made too much of rules, James those who made too little of rules. Paul said works don't save you; James said works must be part of Christian living, or it's only dead faith.
Fair enough, and helpful. Most deeply, though, both Paul and James were confronting people into whose hearts the gospel had not yet sunk deeply enough. Both were writing to those who were doing the right thing for the wrong reasons.
Here's how our friend Adolf puts it.
James directs the word of repentance toward the righteous: not toward obvious sinners who were condemned already by the Law, but toward that kind of godlessness that portrayed itself as piety. He addresses himself not to those who were not able to hear the word but to those who heard it eagerly without doing it; not to those who failed to believe but rather to those who had high praise for faith, but a corpse-like faith lacking obedience; not to those who lacked wisdom but to the wise; not to those who never prayed but to those whose prayer was despicable in the sight of God. . . . Jesus' struggle [was] against transforming religion into rebellion against God. (Adolf Schlatter, The Theology of the Apostles, p. 96)
'Transforming religion into rebellion.'