2 Samuel 18:1

And David numbered the people that were with him, and set captains of thousands and captains of hundreds over them.

David numbered the people who remained with him and placed them under an orderly command with captains over thousands and captains over hundreds. He arranged that organized host into three battalions for the coming battle. Those three divisions were entrusted to Joab, to Abishai, and to Ittai as their respective leaders. The men under them were seasoned soldiers, tried and disciplined, while Absalom's following, though far larger in number, was undisciplined and poorly prepared for war.