Given the advances in chemistry in the last few decades, a type of ammunition is showing up; affordable "highly insensitive munitions." The first of these were developed, for use in nuclear weapons (to get the nuclear reaction going), so that if a bomber crashed, there was no chance any of its nuclear bombs would go nuclear. But these "insensitive explosives" are very expensive. That is changing, and now navies are being offered torpedoes, shells and missiles using slightly more insensitive explosives that are much less likely to go off by accident (because of too much heat, as from a fire on the ship, or an exploding enemy warhead). Such unintended ammunition explosions have long been a threat to warships. So navies see the benefit of paying more for ammo that is more stable. Air forces and armies also have a need for insensitive explosives, just not as urgently as navies do. Nevertheless, the U.S. Army and Air Force are also seeking to adopt the highly insensitive explosives for some of their weapons.
Meanwhile, nations around the world pay over a $100 million a year to dispose of old munitions. The problem is most acute in Eastern Europe, where huge stocks of Cold War era munitions still exist, and become more dangerous each year. In the last decade, there have been over a dozen major explosions in the storage areas for these old munitions.
The U.S. Department of Defense spends over $30 million a year getting rid of elderly munitions. The shelf life of most munitions varies from 5-20 years, depending on the component (shell, fuze, electronics, batteries or propellant.) There's a lot of ammo out there that is about to hit its expiration date. When that happens, you can either refurbish the munition (preferable with expensive missiles), disassemble and recycle it, or keep it and play the percentages.
Major nations must maintain millions of tons of munitions as War Reserve Stocks, to provide a 30-60 day supply of ammo for the opening stages of a major war. It would take over a month for fresh supplies to begin arriving from factories. Replacing elderly weapons from the War Reserve leaves you with a constant supply of old stuff that has to be disposed of. Not too long ago, the old munitions would be dumped at sea, usually in very deep water. But that is not considered ecologically correct these days. Thus the expense of taking apart and recycling the components.
The Department of Defense spends far more on refurbishing old munitions, usually missiles. Billions are spent to upgrade ballistic missiles and anti-aircraft missiles (both air-to-air and ground to air.) Torpedoes, which have been around for over a century, have long been given this kind of attention. Artillery shells, and large caliber machine-gun (20mm and up) ammo are usually taken apart and recycled. That's because the propellant (which is actually a slow burning explosive), detonators (to get the bang going) and high speed (or "high explosives") explosives are chemicals that degrade over time. The degradation makes the explosives less powerful and/or unstable. This makes the munitions less effective, and more dangerous to their users.
To prevent these problems, most countries try to use up munitions before they reach their expiration date. This is not always possible. Firing all the old artillery ammo in stock will wear out the artillery (the barrels are worn each time a shell is fired). Aircraft are expensive to fly, as they must be to use live missiles and bombs. So there is always a lot of old stuff to be disposed of. And the military now has one more incentive to make their ammo using more expensive, highly insensitive munitions.