Could it have something to do with supplying the military during a war? ...maybe?
Only partially. The military obtains most of their 5.56mm ammunition from Lake City Army Ammunition Plant located near Independence, MO. Military ammunition acquisition has little to no affect upon the current supply shortage of commercial ammunition.
Increases in the raw material prices of brass and lead have been a large factor in the two previous ammunition price hikes this year.
There is a current shortage of commercial ammunition production capacity because of demand. When demand exceeds supply, higher prices can be expected. Capacity can not be increased quickly or cheaply in an industry that has been faced with too many feasts and famines.
That's what happened to all the cheap Cold War surplus 7.62x39 and 7.62x54R. My understanding is that the US government bought it all up for the Afghan and Iraqi governments.