David was told that Ahithophel was among the conspirators with Absalom. And David said, “O Lord, I pray you, turn the counsel of Ahithophel into foolishness.”
Absalom and all the men of Israel said, “The counsel of Hushai the Archite is better than the counsel of Ahithophel.” For the Lord had ordained to defeat the good counsel of Ahithophel, so that the Lord might bring ruin on Absalom.
From that day on, half of my servants worked on construction, and half held the spears, shields, bows, and body-armor, and the leaders posted themselves behind the whole house of Judah
It is like a man going on a journey, when he leaves home and puts his slaves in charge, each with his work, and commands the doorkeeper to be on the watch.