King David’s royal court operated with a highly structured chain of command and a careful process for making national decisions. At the center of this administration was a network of elite advisors and military leaders whose roles are understood in two distinct ways. The primary approach among commentators is that the shifts in leadership were chronological. Ahithophel initially served as the king's primary advisor. Following his death, David appointed Jehoiada and Abiathar to fill the vacancy and continue guiding the monarchy.
However, another perspective views these roles not as a timeline of succession, but as a strict hierarchy mapping out the royal decision-making process [רלב״ג, ביאור שטיינזלץ]. According to this view, whenever a major national issue arose, David would first seek the strategic counsel of Ahithophel. Following this initial advice, the king would consult with Jehoiada, who held a senior position in the high court. As a final step, David would turn to Abiathar the priest to seek guidance using the Urim and Thummim.
Only after this thorough process of consultation was complete and a firm decision was made—such as the choice to go to war—was the matter handed over to the military. The execution of the plan fell to Joab, the supreme commander of all the armed forces. As the head of the military, Joab held the most central and critical position within David's government, responsible for turning the carefully weighed advice of the king's council into definitive action.