James is broadly talking about our Christian walk and our faith manifest in our works. What you have to see in the difference in the focus of the two is that James points out that we are not saved by faith alone but rather our faith shown through our works. Note that there is an indivisible physical element of this faith walk that too many Protestants deny.
People like to use that but it's not true. Paul distinctly uses "works of the law" when he means "works of the law". In Romans 11:6 does not use "works of the law". Also in Ephesians he again uses works so no one could boast.
Ephesians 2:8 For it is by grace you have been saved, through faith--and this is not from yourselves, it is the gift of God-- 9 not by works, so that no one can boast.
He is clearly stating that what man does is not how he gets saved. It's "by grace through faith". He said "not from yourselves. In other words not something you do.