Galvanic corrosion is the rapid rusting that happens when two different metals, such as copper and steel, touch in the presence of water. The water acts like a battery, and the more reactive metal corrodes fast at the joint. Plumbing code requires a dielectric fitting to separate dissimilar metals and stop it.
Galvanic corrosion is a specific kind of rapid rusting that happens at the point where two different metals meet in the presence of water. It is the reason a plumber will not just screw a copper pipe directly onto a steel tank. Where those two metals touch with water present, one of them corrodes far faster than it would on its own.
The cause is an electrochemical reaction, the same basic process that runs a battery. When two dissimilar metals contact each other and water bridges them, the water acts as an electrolyte and a small electric current flows between the metals. That current carries metal away from the more reactive of the two. Between copper and steel, steel is the more reactive one, so the steel corrodes while the copper is protected. The corrosion concentrates right at the joint, which is why a dissimilar-metal connection can rust through and leak years before the rest of the pipe shows any wear.
The most common place this shows up in a home is at the water heater, where copper supply lines connect to the steel tank fittings. It also appears anywhere an old galvanized-steel system was partly upgraded with copper. For example, a copper line threaded straight into a galvanized pipe will often corrode and clog at that exact junction, restricting flow and eventually leaking, while the copper looks fine.
Plumbing code prevents this by requiring a barrier between dissimilar metals. The usual solution is a dielectric union or dielectric fitting, which has a non-conductive plastic or rubber insert sandwiched between its two metal ends. That insert breaks the electrical path, so no current flows and the galvanic reaction stops. This is the same protective idea behind the anode rod inside a water heater, which is a reactive metal deliberately placed to corrode in the tank's stead. When you see a special fitting between two different metals, its job is almost always to stop galvanic corrosion.
