As David is dying, he calls in his son Solomon to bless him and speak God’s promises over him. David instructs him on what he should do with Joab and Shimei and requests that he show kindness to Barzillai of Gilead. But Adonijah was not done trying for the throne. He made a request of Bathsheba that Solomon rightly discerned as a claim to the throne. And so as per their agreement, he was executed. Solomon sought to rule his kingdom in fairness and enacted punishments that showed mercy to those who deserved death.