Tim Keller, in Ministries of Mercy (his least well known — but perhaps most important — book):
Both James and John use the ministry of mercy as a test.
The apostle John writes his first epistle to set forth the test by which a genuine Christian can be known. One of the tests of Christian love is the ministry of mercy. Christian fellowship must be characterized by the meeting of physical needs. “If anyone has material possessions and sees his brother in need but has no pity on him, how can the love of God be in him? Dear children, let us not love with words or tongue but with actions and in truth” (1 John 3:17-18). Real love is expressed in deed as well as word.
James concludes that a profession of faint unaccompanied by deeds of mercy shows that faith to be “dead,” not genuine faith at all.
“Judgment without mercy will be shown to anyone who has not been merciful. Mercy triumphs over judgment! What good is it, my brothers, if a man claims to have faith but has no deeds? Can such faith save him? Suppose a brother or sister is without clothes and daily food. 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? In the same way, faith by itself, if it is not accompanied by action, is dead” (James 2:13-17).
In Proverbs 14:31 and 19:17 we are told that to ignore the needs of a poor man is to sin against the Lord. So the poor and needy are a test. Our response to them tests the genuineness of our faith toward God.
No passage is clearer on this point than Matthew 25:31-46. This describes Jesus’ examination of mankind on Judgment Day. He distinguishes those who have true faith from those who do not by examining their fruit, namely, their concern for the poor, homeless, sick, and prisoners.
How can this be? Jesus, when he says, “whatever you did for one of the least of these brothers of mine, you did for me,” is merely expanding on Proverbs 19:17 (“He who is kind to the poor lends to the Lord”).
He is also agreeing with James, John, and Isaiah (cf. Isa. 1:10-17) in saying that a sensitive social conscience and life poured out in deeds of mercy to the needy is the inevitable outcome and sign of true faith. By such deeds God can judge true love from lip service.