King David draws a sharp line between his moral worldview and the mindset of greedy opportunists who try to win favor at the expense of others' lives. To prove that he does not desire the death of his enemies or reward those who harm them, he recalls his harsh reaction to the Amalekite youth who brought him the news of King Saul's death.
A fundamental difference exists between simply passing along neutral information and delivering a glad tiding. A glad tiding implies positive news that benefits the listener, usually based on firsthand observation [מלבי"ם]. The Amalekite viewed himself as a bearer of good news, assuming his report would bring David joy [מצודת דוד] and hoping to receive a handsome reward [רש"י, רד"ק]. To David, however, the youth was merely a messenger of neutral facts, as David saw no benefit or reason to celebrate in Saul's passing [מלבי"ם].
In fact, David likely did not even believe the youth had actually killed Saul, understanding that the young man was making the claim solely to win a prize. Despite this, David sentenced him to death because he rejoiced over the king's demise and sought to profit from it [מלבי"ם], and because he dared to claim he had struck the king [ביאור שטיינזלץ].
When describing the execution, the primary approach among commentators is that David did not carry out the killing personally. Because he ordered one of his servants to execute the Amalekite, the act is considered as if David did it with his own hands [מצודת דוד, רד"ק]. Alternatively, some suggest that David physically grabbed the man while the servant delivered the actual blow [רד"ק]. David's mention of giving the youth a reward for his news was heavily ironic; instead of the gift he anticipated, his payment was his execution [רש"י, ביאור שטיינזלץ].
Recalling this history serves as a severe warning to the murderers who now stand before him. This raises a natural question: why would these killers dare to approach David in the first place, knowing he had executed the Amalekite for a similar act? They mistakenly believed the Amalekite's execution was a rare, temporary ruling. Since a person is not normally convicted based solely on their own confession, they assumed David only killed the youth because he was an Amalekite. David completely dismantles this assumption by explaining his logic. If he executed the Amalekite as a special ruling—even though the youth merely claimed to have killed Saul, and a person cannot legally incriminate himself—he will most certainly punish wicked men who actually committed a murder [חומת אנך].