1 Kings 2:34

So Benaiah the son of Jehoiada went up, and fell upon him, and slew him: and he was buried in his own house in the wilderness.

The verse falls within the history of Solomon's reign, the first section of 1 Kings, which covers the undivided kingdom under Solomon. It stands in the narrative running from 2 Samuel 8 through 1 Kings 2 in which war continued between Israel and Judah after Saul died, when Saul's friends tried to keep Saul's son on the throne to be like the nations around them, while God showed that He Himself selects the rulers of His people, until after years of war David triumphed and became the beloved king over all the tribes. In its immediate setting, after David's death Solomon is carrying out the charge his father had given him concerning the security of the throne, and Benaiah's killing of Joab is one action in that execution.

The verse records that Benaiah the son of Jehoiada went up, fell upon Joab, slew him, and buried him in his own house in the wilderness, and Joab was put to death for a further offence and insult to the king. Joab's resort to the altar at his death, as the surrounding account relates, shows his belief in Jehovah. Joab had fled to the horns of the altar, and Benaiah killed him afterward, for flight to the altar did not protect him from punishment, and the episode is an example that people who seek refuge in conscience while holding opinions or practicing religion that cause practical harm are not shielded, for conscience does not protect wrongdoing from lawful punishment.

Joab was put to death for failing in loyalty to his king by supporting Adonijah's unholy ambition to take advantage of David's old age and seize the throne, when the Lord's will and David's mind were that Solomon be crowned king. Joab was slain a little later, after Nathan interfered with Adonijah's plan and Solomon was crowned, together with Adonijah, while Shimei who had cursed David was also put to death for failing to abide by his conditions of life. The death of Joab was the last result of his jealousy, which grew and showed itself as a regrettable weakness that at last led to his being slain.

The verse records the end of Adonijah's attempted seizure of David's throne, in which his plot was defeated and he was killed, and the death is a fulfillment of Nathan's warning that the sword would not depart from David's house and is another consequence of David's sin concerning Uriah. The chapter, including the burial described in the verse, belongs to the subsequent history of David that shows how completely Nathan's terrible denunciation was accomplished in the judgments that came upon David after his great wickedness in the case of Uriah, by which he gave great occasion to the enemies of the Lord to blaspheme, and it proves that this transgression was not covered up nor in any way excused by the sacred writers.