In modern, professionalized armies, command structures tend to be composed of units and subunits, and the chain of command goes from commanding officer of a superior unit to the commanding officer of subordinate unit.
Please note, that I am not asking about whether military forces were always composed of separate units, but the history of a chain of command built around units instead of officers (or other type of leader). In the current U.S. Army, for example, it's not quite the case that a First Lieutenant reports to a Captain. The commanding officer of a specialty platoon reports to the commanding officer of a company. The commanding officers of a specialty platoon and a company are typically a First Lieutenant and a Captain, but if these officers are incapacitated in battle, the next highest ranking officer takes the role of commanding officer.
What is the history of this form of organization? This seems quite different, than say, feudalism, where knights were personal followers of their generals. If a knight fell, his vassals would not necessarily keep operating as a unit.
Book suggestions on this topic are very welcome. Huntington's Soldier and the State and Preston's Men in Arms look very relevant.