The longevity of muffler and pipes depends on what kind of steel the components are made of, how pipes are routed under the car, where the muffler is located, and whether or not the vehicle has a catalytic converter.
Original equipment pipes made of aluminumized steel generally last five to seven years, except in areas with a lot of road salt and moisture. In these areas, pipes may need replacing after three to five years.
Most aftermarket pipes, by comparison, are made of ordinary steel which is good for about three to five years of service. Aluminumized and stainless pipes are better, but cost more.
With mufflers, stainless holds up the best, followed by doublesided galvanized steel. Single-sided galvanized and aluminumized hold up fairly well, while plain steel offers little or no corrosion resistance.
As a rule, the hotter a muffler runs the longer it lasts. Mufflers on vehicles with catalytic converters run hotter and last longer than those on older vehicles without converters. Mufflers located ahead of the rear axle last longer than those located after the rear axle.
Mufflers rust from the inside out. Rust is caused by moisture in the exhaust. Moisture condenses in the muffler when the engine is shut off and the muffler starts to cool. Some mufflers have a small pin hole that allows condensation to seep out.
One aftermarket muffler manufacturer puts a small packet of a special moisture absorbing chemical inside some of their mufflers to fight internal corrosion.