1 Kings 2:35
And the king put Benaiah the son of Jehoiada in his room over the host: and Zadok the priest did the king put in the room of Abiathar. And the king put Benaiah the son of Jehoiada in his room over the host: and Zadok the priest did the king put in the room of Abiathar.
The verse records Solomon putting Benaiah the son of Jehoiada over the host in the room of Joab as commander of the army, and putting Zadok the priest in the room of Abiathar as priest.
The appointments took place after Solomon became king and was crowned, and were part of the settling of the kingdom.
In making them Solomon was carrying out David's charge after David's death.
The appointments followed the removal of Abiathar, who had been expelled from office for interfering in the succession to the throne and sent to Anathoth, his birthplace.
That settling involved Nathan, knowing the Lord's will and the king's mind, stopping Adonijah's unholy ambition to take advantage of David's old age, while Joab failed in loyalty to his king.
A little later Adonijah and Joab were slain, and Shimei, who had cursed David, was put to death for failing to abide by his conditions of life.
The verse stands within the account of Adonijah's attempt to seize David's throne, whose plot was defeated through Nathan's wisdom and ended in Adonijah's overthrow and death.
That outcome demonstrated Nathan's warning that the sword would never depart from David's house.
Abiathar's removal fulfilled the judgment pronounced against the house of Eli, while Zadok took up the priestly office in his place.
The verse belongs to the continuous narrative from 2 Samuel 8 through 1 Kings 2 of the war between Israel and Judah after Saul died, when Saul's friends wanted to keep Saul's son on the throne as the surrounding nations did.
In that strife God showed that He Himself selects the rulers of His people, and after years of war David triumphed and became the beloved king over all the tribes of Israel.
It belongs also to the later history of David from 2 Samuel 11 through 1 Kings 2 that proves the prophet Nathan's denunciation after David's great wickedness in the case of Uriah was completely accomplished in the judgments that came upon David.
That history shows the transgression was not covered up nor excused.