This is pretty much how medieval armies worked
When a medieval (by which I mean the typical feudal European) nation went to war, the king would call on his vassals to fulfill their military obligations. This typically involved showing up with some number of soldiers (depending on the exact details of the vassal agreement, as well as how invested the vassal is in the conflict) and then following the Marshall (this may be the King, or whomever the King decides to appoint in his stead) around as they all did army things.
There was a hierarchy, but it was about as clear as in civilian life. Ie, not particularly, once you got close in rank. The only clear heirarchy was as follows:
The King > The Marshall > The Vassal Commanders > The Troops
Within these groups was a lot of jockeying for position, and a fair bit of blurring happened at the borders as people's social rank started interfering. Such examples included:
The lord of some backwater province (who thus can't afford the latest equipment) vs an unlanded knight within another lords household. Technically, the landed lord had superiority, but if the unlanded knight's liege was particularly wealthy and prestigious, he could get away with a lot more than his apparent social position.
The wealthy landowner vs any poor noble. At this point the differences are almost impossible to tell just by looking at them, so whislt the noble is technically of a higher rank, if the commoner acquits himself well he could have far more clout than expected.
The Marshall vs the King's favoured lords. Typically, the Marshall is also a favourite, but if he isn't, or just if he doesn't get on with them, the King's favourites could use their personal connection to form their own factions within the army and do their own thing.
A commanding lord vs a designated stand-in. For one reason or another, a lord may not attend the army personally (health, prior commitments, just not caring enough) and so will send a stand in, such as a son or trusted Captain. As this individual will be acting under borrowed power much of the time, they will naturally be in a weaker position compared to a Lord who attended personally.
One commander vs another. The man who brought more soldiers with him on campaign typically took higher precedence as well. This typically meant the richer lords had another fact in their favour, but a local, poor lord could probably scrape together more soldiers than a rich one on the other side of the kingdom could be bothered to send, which muddied the waters yet further.
Thus compared to a structured, professional army, the ranks of the people in charge are much less clear and can shift depending on providence, favour and power. The Marshall may have to offer concessions to powerful factions within the army to entice them to support his plans, and a particularly poor showing on his behalf combined with a united opposition could see him stripped of his title by the King.