First off, sorry if it was posted before, I did a quick search on this sub and found nothing.
Also, how was ammunition distributed and what would an archer (horse archer especially) do if he ran out of arrows before his comrades?
Broadly speaking, a single quiver fits around 25-30 arrows, and an archer would be expected to carry up to 50 arrows, with some sources up to 100, depending on the number of quivers carried, the size of the arrows, and the manner in which arrows were carried.
The Byzantine Emperor Maurice decreed that light-armed infantrymen (psiloi) "should carry bows on their shoulders with large quivers holding around thirty or forty arrows" (Strategikon).
The Arab archery source Book on the Excellence of the Bow and Arrow c.1500AD states that a quiver carries 25-30 arrows, but that one "should not limit himself to that number in battle", advising that archers stick arrows in their belts and boots.
An medieval English archer would carry his arrows in a quiver or "sheaf" of 24 arrows to be transported. In battle, archers would usually have two or three sheaves, and when shooting from a defensive position would plant them in the ground for easy reach.
Parthian horse archers may have carried around 30 arrows in their quivers, and other steppe archers carried a similar amount of arrows in quivers.
Korean archers during the Chosun era carried 20 arrows, along with 10 "baby" arrows shot from the tong-ah tool.
An archer during the Ancient Greek times may have carried up to 200 arrows (though the gorytos, the quiver used by Scythians and adopted by Greek archers, was meant to carry both the bow and arrows, so the capacity would likely be far less).
This is a bit of cross-section of archery from across the world and different time periods, but I think it's reasonable to conclude that a "typical" archer would carry around 25 arrows in a quiver (though smaller arrows and larger quivers will pad that number out), and may carry one or more additional quivers.
As for supplying archers, there were several ways:
The Parthian horse archers, for example, the Battle of Carrhae were able to sustain their barrage on the Roman troops by returning to the camel train to resupply. Some sort of centralised storage or supply depot would likely have been part of any advancing army, so running out of arrows was not so problematic, considering that armies brought hundreds of thousands of arrows with them (estimates of up to 500,000 at Agincourt, possibly up to 2 million at Carrhae).
Shooting enemy arrows was certainly a viable tactic. At the Battle of Towton during the Wars of the Roses, the Yorkists and Lancastrians were fighting during a snowstorm. The Yorkists, with a tailwind, shot heavier short-range arrows that struck the Lancastrian force. The Lancastrians, shooting into the wind and mistaking the close distance of the Yorkists due to the type of arrow used, used heavy arrows to shoot back, which all fell short. The Yorkists shot their long-range lighter arrows, and then advanced and picked up the Lancastrian arrows and shot them too.
This possibility was one of the reasons why "baby" arrows such as the Korean pyun-jun were used from the tong-ah - to prevent enemies from shooting the arrows back at them, since the arrows were too short.
Sources & Further Reading