I Kin. 2:13-46
With the advent of a new king, shedding of blood frequently occurred. If the king forcibly gained the throne, a bloodbath of his enemies and rivals could be expected. In a peaceable ascension to the throne, there were also certain individuals who posed a real or imagined threat to the new king. Solomon had been informed by his father of delayed punishment of two such men.
Obviously Adonijah, Solomon’s older half brother was a perceived threat to the new king. Taking part of a deceased king’s harem was equivalent to claiming his kingdom. When Adonijah asked for Abishag to be given to him as a wife, Solomon did perceive that request as equal to asking for the kingdom. Benaiah became the king’s executioner as he killed Adonijah.
Many years earlier, God had stated to Eli that the priesthood would be taken from his descendants. Abiathar, the last of Eli’s lineage had followed Adonijah as he had attempted to become king instead of Solomon. Solomon spared his life because of his loyalty to David, but did remove him from the priesthood and sent him into exile. Zadok succeeded him as priest.
Joab had also followed Adonijah’s rebellion. Upon hearing of the purging of Solomon’s rivals, he fled to the tabernacle and held the horns of the altar for refuge. That was a holy place that even criminals could go to escape death. However, a presumptuous murderer should be dragged away and put to death. Upon Solomon’s orders Benaiah executed Joab for his murders. He was then named commander of the army of Israel.
Shimei was placed under house arrest for his crime of cursing David during Absalom’s rebellion. He swore an oath that he would not leave. Three years later, he went to Gath to retrieve two runaway slaves. When word of that came to Solomon, he commanded Benaiah to put him to death.
With Adonijah, Joab, Shimei and Abiathar removed from his presence, Solomon had purged the political, religious and military threats from his reign.