2 Samuel 20:23

Now Joab was over all the host of Israel: and Benaiah the son of Jehoiada was over the Cherethites and over the Pelethites:

2 Samuel 20:23 stands in 2 Samuel, which covers almost the entire reign of David over all Israel, in the chapters 19 to 21 portion near the close of his reign. The two books of Samuel are one book in Hebrew, named from the prominence of Samuel in the first part, and were compiled from the books of Samuel and Nathan and Gad the seers, the records of the kingdom kept by scribes and secretaries, and the poetry and songs of the nation, by one like the faithful Nathan or Gad who tells the whole truth without fear or favor. The great event of the books of Samuel is the establishment of a monarchy centered on the three leading characters Samuel, Saul, and David.

The verse belongs to the history in 2 Samuel 11-24 and 1 Kings 1-2 that follows David's great wickedness in the case of Uriah, by which he gave great occasion to the enemies of the Lord to blaspheme. Its immediate setting is the revolt of Sheba the son of Bichri, which grew out of a quarrel between the men of Judah and the men of Israel after Absalom's revolt was suppressed and threatened to prove very serious.

It records part of the history of David's reign showing the difficulties he encountered and his troubles with Joab. It shows that David's troubles were not yet ended as chastening for his sin in the case of Uriah, showing how completely the terrible denunciation of the prophet Nathan was accomplished in the judgments that came upon David. The account is told with detailed faithfulness that stamps it with inspiration and shows that God does not hide the sins of even the greatest kings.