He turned them over to the Gibeonites, and they executed them on a hill before the Lord. – 2 Samuel 21:9a (NET)
It is said that “During David’s reign there was a famine for three consecutive years. So David inquired of the Lord. It is recorded that the Lord said, ‘It is because of Saul and his bloodstained family, because he murdered the Gibeonites.’” (21:1) The Gibeonites, by way of recollection, were the group of people that came to Joshua and Israel, pretending to be from a faraway land, offering terms of peace. Joshua and Israel made a treaty with them, and upheld the treaty (though they would become woodcutters and water-carriers for Israel) even when it was discovered that they had lied and misrepresented themselves.
The author here takes step to cause a reader to remember these things (which are obviously closely connected with the exodus and the conquering of the promised land, calling to mind the Creator God’s actions on behalf of His people), by writing “The Israelites had made a promise to them” (21:2b); “but,” he goes on to write, “Saul tried to kill them because of his zeal for the people of Israel and Judah” (21:2c).
It is in response to this knowledge, along with the word that he is said to have received in his inquiry from the Lord, that David summons the Gibeonites and says to them, “What can I do for you, and how can I make amends so that you will bless the Lord’s inheritance?” (21:3) Before going on, one must take note of the explicit connection to the Abrahamic covenant that David is shown to be making. David, of course, is referring to Israel when he speaks of the “Lord’s inheritance.” By speaking of “blessing” that inheritance, David invokes the promise to Abraham, which must have been well understood by the Gibeonites (because they lived and served among Israel, and presumably would have known the story of Israel quite well), that Israel’s God would bless those who blessed Abraham (and by extension, blessed Israel).
Here, David appears to be seizing on an opportunity. He is using the fact of the famine in a calculated manner for the sake of his own kingship and that of his progeny. Additionally, he knows that the Gibeonites are motivated by revenge, so in calling to mind the blessings promised (in the Abrahamic covenant) for those that bless Israel (with the king representing Israel in such a way that by their serving the king they bless him, the nation as a whole, and themselves in turn), he is going to turn that mindset of vengeance in his own favor.
After being asked this extraordinarily calculated question by David, “The Gibeonites said to him, ‘We have no claim to silver or gold from Saul or from his family, nor would we be justified in putting to death anyone in Israel.’” (21:4a) Feigning ignorance of where all of this was leading, “David asked, ‘What then are you asking me to do for you?’” (21:4b) “They replied to the king, ‘As for this man who exterminated us and who schemed against us so that we were destroyed and left without status throughout all the borders of Israel---let seven of his male descendants be turned over to us, and we will execute them before the Lord in Gibeah of Saul, who was the Lord’s chosen one.’” (21:5-6a) In what must have been a considerable exercise of self-restraint in the midst of jubilation, David says, “I will turn them over” (21:6b).