2 Samuel 20:7

And there went out after him Joab’s men, and the Cherethites, and the Pelethites, and all the mighty men: and they went out of Jerusalem, to pursue after Sheba the son of Bichri.

2 Samuel 20:7 belongs to the closing, later history of David's reign, coming after the suppression of Absalom's revolt and dealing with the revolt of Sheba the son of Bichri. That revolt grew out of a quarrel between the men of Judah and the men of Israel and threatened to prove a very serious thing. The family troubles surrounding the verse grew out of David taking many wives, with sons he could not control and idleness, luxury, and jealousy among his children.

The surrounding narrative includes Absalom's rebellion and death, David's lament and return to Jerusalem, his troubles with Joab, and his numbering of the people. The trouble over Sheba was one of David's continuing troubles and calamities directly traceable to his sin in the case of Uriah, after a great wickedness that gave great occasion to the enemies of the Lord to blaspheme. It shows that sin does not pay and that the chastening hand of God was upon David all his life long.

Together with the terrible denunciation of the prophet Nathan, the judgments that came upon David show how completely that denunciation was accomplished, alongside David's own humble confession of his transgression recorded for all future time. The account is told with detailed faithfulness and openness that does not hide, cover up, or excuse the sins of even the greatest kings, which marks it as inspired.