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.