Most upvoted comment
Top rated history books on Reddit rank no. 44
What were the logistics of gunpowder (i.e. getting the raw materials, refining, measuring and transporting) in the early days of gunpowder wars for different cultures.(r/AskHistorians)
The salt – saltpeter usually – is the really difficult component. It is generally mined and serves as the easiest portion of the supply train to disrupt.
Most militaries wouldn’t want to make their own powder on the march, however. Granual size is so important to the burn rate that it must be carefully managed and daylight hours are too important for movement to waste on powder grinding.
And you don’t want to grind powder by firelight.
Edit — per /r/Askhistorians rules, I should post a source.
Source: I teach about firearms safety for the Virginia Department of Game and Inland Fisheries and am advance-qualified on Muzzleloaders (black powder). Also, Salt: A World History by Mark Kurlansky talks a lot about saltpeter and the supply chain that surrounded it.