Gratitude and international diplomacy intersect when King David seeks to repay a past kindness to the deceased king of Ammon. This gesture, however, carries deep historical and legal complexities.
David's motivation stems from a deeply personal debt of gratitude. Years earlier, while fleeing from King Saul, David sought refuge for his family by entrusting them to the care of the king of Moab. The Moabites betrayed this trust and slaughtered his entire family. The sole survivor of this massacre was David’s brother, Eliyahu, who managed to escape and found safe haven with Nahash, the king of Ammon, who protected his life [רש״י, מצודת דוד, ביאור שטיינזלץ]. This bitter betrayal is the reason David later attacked Moab with a severity unmatched against his other enemies [רש״י].
Wishing to return the favor he received, David initiates a diplomatic mission. He dispatches official ambassadors to the land of Ammon to comfort the new king, Hanun, following his father's passing [ביאור שטיינזלץ].
Despite David’s noble intentions, his action sparks a debate due to an explicit Torah command that forbids seeking the peace and welfare of the Ammonites. Some authorities defend David's decision, arguing that this prohibition does not apply when the goal is simply repaying a debt of gratitude for a past kindness. In stark contrast, the Midrashic tradition heavily criticizes David. According to this view, David attempted to be overly righteous by extending mercy where God had forbidden it. This perspective serves as a warning that showing misplaced compassion toward these specific nations ultimately leads to disgrace and conflict, which is precisely the disastrous outcome that followed this diplomatic delegation [חומת אנך].