Solomon removed Abiathar from being priest to the LORD because of his association with Adonijah, though he spared his life because he had carried the ark and shared David’s hardships (1 Kings 2:26-27). The text says this fulfilled the word of the LORD about the house of Eli (1 Kings 2:27). Zadok was put in Abiathar’s place as priest (1 Kings 2:35).
In 1 Kings 2:26–35 Solomon secures his rule by dealing with two key figures from David’s era. He banishes Abiathar from the priesthood instead of executing him, citing Abiathar’s past service and suffering alongside David. Then Solomon orders Joab’s execution after Joab clings to the altar for refuge. This unit sits in the opening reign narrative where Solomon acts on David’s final instructions and resolves threats from rivals and compromised leaders.
This passage presents Solomon securing his early reign by removing two powerful figures tied to the previous administration: Abiathar the priest and Joab the commander.
A careful answer keeps the immediate passage, the book's argument, and the whole-Bible storyline together, so the question is answered in context instead of as a detached idea.
Start with 1 Kings 2:26-27, then read the surrounding section so the answer stays connected to the passage's flow.
26To Abiathar the priest said the king, Get you to Anathoth, to your own fields; for you are worthy of death: but I will not at this time put you to death, because you bear the ark of the Lord Yahweh before David my father, and because you were afflicted in all in which my father was afflicted.
27So Solomon thrust out Abiathar from being priest to Yahweh, that he might fulfill the word of Yahweh, which he spoke concerning the house of Eli in Shiloh.