Part of it is the economy of scale. If there were going to be 32 ships armed with the gun each needing lots of rounds but instead you only build 3 ships that means instead of a big automated factory you build much smaller runs of the munitions built by hand.