All of the above. They would hunt and gather what they could and would be sent food and supplies from nearby villages. Supply reasons were the main reason why inland conquest wasn’t very popular until the Romans and their baggage trains, and most major cities were coastal. Easier to ferry in supplies from wherever they came from
It did depend a lot on the specific conditions. An army could often be able to collect quite a bit of food from the locals. Either hunting and gathering or pillaging/taxation of the local farmers. The problem with this is that it was unreliable and it often meant the army would spread around a lot and not move very fast. So a general would always want to provide enough supplies for their army as they marched, although some local resource gathering would usually be done anyway.
So the generals would set up supply lines from home to their army. Whenever they moved their army they would always have to tell the supply line so they could shift the supplies. As you could imagine this all depended heavily on allies. Both as a source of some supplies as needed but also to make sure nobody attacked these supply lines. It meant that armies could not march far into unfriendly territory. And passing for example a single castle without besieging it could easily cut the supply lines forcing a retreat. We have several examples of wars being lost due to lost alliances cutting the supplies. We also have stories of generals losing an army when they had to gather their own supplies and ended up getting picked off, deserting or fighting each other.
> Particularily stuff like supplying huge horde armies or cavalry armies.
Steppe hordes didn’t need many supplies. Their horses were small and hardy enough that they could survive simply from grazing on the steppe, and the warriors could drink the horses’ milk.
Cavalry of agrarian societies on the other hand was very expensive because their horses were bred to be big and strong, and needed additional fodder apart from grazing. That fodder they would have to somehow procure from the peasants (buy, steal, extort, pillage… while this makes a huge difference to the peasants, it’s not that different for the army). That’s why European powers didn’t really have “cavalry armies”, instead their cavalry was a small elite troop supporting a way larger number of infantry (who would also have to get food from the peasants, but at least only for themselves, not for the horses too).
Huge supply networks really only became a thing with the invention of the railroad. It was also around that time that armies started to need such huge amounts of ammunition (which have to be externally supplied anyway) that food for the soldiers becomes kind of an afterthought.
Latest Answers