In this chapter, the Gibeonites are given justice against Saul, and David's men kill some giants.
As I mentioned briefly in the previous chapter, this chapter is not chronological. In fact, even the two stories in this chapter are both selected from random points in David's life. The way you should think about the book of Samuel is that it contains one, long biography on David (which concluded in the previous chapters), and now the rest of the book is going to be random stuff that didn't thematically fit into the previous story.
So the first story is about the Gibeonites. To remind my readers, the Gibeonites were a native people, inhabitants of Canaan before the Israelites arrived in force. The Israelites had been commanded (most strongly in Deuteronomy 20) to destroy all the native tribes of Canaan, which very much included the Gibeonites amongst others. After Israel had destroyed Jericho and wiped out large chunks of the Amorite kingdom east of the Jordan, the Canaanite peoples were all terrified. Gibeon, therefore, sought to deceive Israel in order to form a treaty with them, and this story is detailed in Joshua 9.
The treaty is essentially a lord/vassal treaty, with Gibeon agreeing to serve Israel and Israel agreeing to protect Gibeon. In fact, in Joshua 10 Israel found itself in the uncomfortable position of having to go out and rescue Gibeon from a coalition attacking them, which they are responsible to do as Gibeon's lord.
Remarkably, in this chapter the LORD sends a famine on Israel because Saul had violated the covenant with Gibeon by trying to murder them. So even though Israel sinned by swearing an oath to defend a nation they were supposed to destroy, the LORD was now holding them guilty for breaking that oath, even though Saul is doing what Israel was originally commanded to do. So the first thing I see in this chapter is how the LORD cares more about what Israel promised it would do to others than what he had commanded them to do.
The second thing I see in this chapter is how Saul is still trying to act in a righteous way and still getting it wrong. People ask, "Is Saul also among the prophets?" As if to say, "Since when did Saul start hanging out with righteous people?" Back in 1 Samuel 13 Saul offered a sacrifice because he was too afraid to wait for Samuel, and he wanted to do something to rally his men and show that they had divine favor. And now he's running around killing Gibeonites because of his "zeal for the sons of Israel", but the LORD sends judgment on Israel because Saul sinned in doing this.
I would almost feel bad for him, except that I'm not convinced that Saul is really trying to do the right thing. Remember this: out of the many years that Saul reigned in Gibeah, he never brought back the ark of the covenant from Kiriath Jearim. It's hard to know for sure what was going on in Saul's heart, but there are many times when it appeared that Saul was more interested in the appearance of holiness and devotion rather than the substance. He was able to give off the appearance of righteousness when things were going well in his life, but when the pressure started to build up, he would go and consult with a spiritist (1 Samuel 28).
In retribution, the Gibeonites ask for 7 of Saul's descendants to be given to them to kill as vengeance for the blood that Saul shed. Strictly speaking, this is contrary to the principles of the Law. The Law says that no man should be put to death for the sins of the father (Deut 24:16) and that's exactly what happens here. Nevertheless, David assents because with Saul already dead and the LORD judging Israel for Saul's crimes, he needs to do something to bring peace to the land. The reason why this situation is somewhat different is that Saul was the king of Israel, so in a sense he was acting in an official capacity, representing the nation. And by breaking Israel's treaty with Gibeon, Israel as a whole is considered guilty and that's why the LORD is punishing the entire nation.
At this point, David just asks the Gibeonites themselves what they want for atonement, "that you may bless the inheritance of the LORD", i.e. Israel. The Gibeonites decline money; they want revenge, so David has little choice but to give it to them. Also, because the Gibeonites are not part of Israel, they do not feel bound by the commands of the Jewish Law, and while David is bound by the Law, he is also bound to give the Gibeonites justice.
Furthermore, the Law also states that the bodies of the dead are not to be left unburied overnight (Deut 21:22), but in this chapter the bodies of the dead were left exposed from the harvest until the first rain (i.e. from late summer until winter, a few months).
David deliberately spared Mephibosheth because he had sworn an oath to show kindness to the descendants of Jonathan, but otherwise he gives seven sons of Saul to the Gibeonites, and the Gibeonites kill them and leave their bodies exposed before Gibeah, which was Saul's royal city and part of the tribal inheritance of Benjamin. In essence, they are leaving the bodies rotting in front of Saul's own tribe in a very deliberate, disrespectful fashion.
Aiah honors the bodies of the dead by staying near them for several months, the entire time they were exposed, and preventing wild animals from tearing them apart, and David also honors Saul by collecting and burying all of Saul's dead kindred in Saul's father's tomb. This is David's final act of kindness for Saul. In 1 Sam 24:20-22 Saul asks David to show kindness to him and his descendants when David is made king, and I think David has kept the promise he made at that time.
The second half of this chapter is all about giants, and the killing thereof. This part is a collection of four different giants who are killed at four different times by four different people. In the first story, it says that David became weary and during his point of weakness, one of the giants sought to kill him, but Abishai, the man of bloodshed whom David rebuked so many times, came to rescue him and killed the giant. This gives us more insight into why David stopped going out to battle (he did not go out in 2 Samuel 11:1 which ironically led to the sin with Bathsheba, and then again his men pleaded for him to remain in the city in 2 Samuel 18:3 when fighting the men of Absalom). It appears that as David became older, he started losing his strength and endurance during battle, and his men were afraid that he would be struck down. This is why, in the second half of his life, he became more of a political ceremonial figure than a military commander, even though he had a lot of military experience in his youth. This story also shows clearly why David cannot move against Joab or Abishai: Abishai literally saved his life.
Of the other three giants mentioned, the only one I want to talk about in particular is Goliath the Gittite. David himself killed a giant named Goliath, who was a Gittite (resident of Gath). This leads some (such as the Jewish commentator Rashi) to suggest that "Elhanan the son of Jaare-oregim" is David. Factually, it makes sense, since it's hard to believe there is a second Goliath the Gittite who was killed by an Israelite. However, the name Elhanan is unfamiliar and later passages in both Samuel and the book of Chronicles refer to another "Elhanan from Bethlehem", so it strikes me as more likely that this is referring to some other person. Not to mention, David fought Goliath at Socoh and Azekah, so Gob is also unknown to us before this chapter. However, verse 22 possibly implies that Elhanan is David because it says these four giants "fell by the hand of David and by the hand of his servants". We might interpret that to mean that David is one of the "hands" that killed a giant in these stories. On the other hand, it might mean that David was partially responsible for killing the giants because he was the commander of these men and trained them in warfare.
As a truly minor point, verse 21 refers to a "Shimei, the brother of David", which is probably a reference to Jesse's second son, who is variously called Shammah (1 Samuel 16) or Shimeah (2 Samuel 13:3).
Lastly, I want to talk about these four stories at a higher level. In particular, I see these stories as being the measure of David's greatness. David struck down one giant and by that he became the hero of Israel and a great man. But this chapter, I think, is an even greater honor, because David did more than kill a giant: he raised up an entire generation of men who went out and slew giants. We have not just one, but three (or possibly four) distinct stories about men serving under David who each killed a giant. Killing one giant is a hard thing, but how amazing is it that David was able raise up and inspire others to go out and kill the giants that were threatening to oppress their nation? This is, I think, the more remarkable accomplishment and I think it is one of David's greatest legacies. To slay one giant takes heroic faith, but to train others to slay giants takes heroic leadership.
This should be our goal in life: to do great things, and also to bring great things out of others, to inspire others to greatness and to have the lives of our children be more remarkable and glorious than our own. In all of these things David excelled, in spite of his weakness and mistakes, and that's why he is one of the most honored figures in the bible.