The last lines in James 2:14-17 simply put forth what has been implicit all along:
14 What good is it, my brothers, if a man claims to have faith but has no deeds? Can such faith save him? 15 Suppose a brother or sister is without clothes and daily food. 16 If
one of you says to him, “Go, I wish you well; keep warm and well fed,”
but does nothing about his physical needs, what good is it? 17 In the same way, faith by itself, if it is not accompanied by action, is dead.
Faith alone (a slogan used in the Reformation in a way unlike what James is here talking about) is not enough. Faith with action — with works — the only kind of faith that really works.
Now to clarify that Reformation comment: James is not talking about works/deeds that put forth a case before God that we deserve to be saved. Instead, he is talking to a specific context: those who claim to be Christians but who do not act like it; those who claim to be followers of Jesus but who do not really follow him. Those who claim they believe/trust the Lord who was poor but do not treat the poor well. It’s about living out one’s claims.
This is Sermon the Mount kind of stuff; this is about good trees producing good fruit. Bad fruit — no works — indicates bad tree — no faith.