Faith without works is dead
I don’t picture James and Paul standing toe-to-toe with each other with contrary understandings of the gospel. Instead, they are standing back-to-back with each other fighting two different enemies and together defending a unified understanding of the gospel. Paul is fighting against the false idea that we can earn our salvation with our works (which, by the way, is the same battle Luther was fighting in the Reformation when confronting the teachings of the Catholic Church). James, on the other hand, is fighting against an easy believism that had reduced salvation to intellectual belief.
What James is confronting in his letter is different from what Paul is confronting. Paul wants us to avoid thinking we need to work in order to earn salvation. Then there’s the danger James wants us to avoid: thinking that works are not necessary as evidence of our salvation. Again, works are not the basis of our justification. Final justification is not based on our works, but rather James is wanting us to see that when we stand before God on the day of judgment, it will be clear whether we had real, true, and authentic faith or dead, demonic faith.