Hashem appeared to him (Avraham) in the Plains of Mamre while he was sitting at the entrance of the tent in the heat of the day. (Genesis 18:1)
Rashi says that Hashem brought the sun out of its sheath and made it shine intensely on this day, so that Avraham would not be troubled with guests and passersby. However, Hashem saw that Avraham was more aggrieved by the pain of not having guests than from his recent Bris Milah (circumcision), so therefore He brought angels to him in the form of men.
The famous question asked here is: Why was Avraham so bent out of shape to do chesed in this situation? Now, if someone had asked him for a favor, we’d understand his desire to respond favorably, even in his enfeebled condition. But in this instance, there was nobody in front of him asking for a favor or in need of his kind deed! And considering he had just performed a Bris Milah on himself … and that he was 99 years old … and it was then the hottest day in recorded history … why was it necessary for Avraham to be up on his feet and involved with this?
R. Moshe Feinstein, ZTL (Darash Moshe) and R. Michel Barenbaum, ZTL (Sichos Mussar) and other classic Torah commentators answer along the following lines:
Most people view chesed as something we do reactively, to respond to the need of a person in front of us. However, Avraham understood that for a Jew, the need to do chesed is something that arises from within and from an intense inner hunger to perform chesed. It is something the Jew needs for himself and his own spirituality -- irrespective of the need of the person in front of him! Without a doubt, the prime beneficiary of an act of chesed is always the giver. Just as a sick person doesn’t deny himself food because of his illness, so too Avraham didn’t cease to have a deep need to perform acts of kindness merely because of his physical pain and the discomfort of the day.
Understanding this Yesod (foundational principle) helps explain several anomalies concerning Avraham. The Torah spends a good deal of space recounting for us Avraham’s hospitality towards the angels and his pleading on behalf of the residents of Sodom. Ironically, in both these instances, nobody benefited from his magnanimous deed, as the angels didn’t really eat his food, and his begging Hashem to spare Sodom was unsuccessful.
The Torah is teaching us that chesed is to be performed because it’s the right thing to do and because the Jew’s soul needs it … irrespective of the ‘results’ it brings about.