A common cause of corrosion in plumbing pipes is galvanic reaction between dissimilar metals. If copper fittings are connected directly to galvanized steel, as an example, both metals are likely to corrode. The usual remedy is to remove the affected items and replace the fitting with a dielectric device. Dielectric fittings generally employ an electrical insulator to prevent metal-to-metal contact and that’s an appropriate fix; however, there is another factor to consider.
In a lot of buildings the electric distribution system is grounded through plumbing supply lines and a dielectric connection could interrupt a critical path to ground. That’s an undesirable and potentially unsafe condition, but one that’s easy to correct. Appropriate shunts (electrical conductors) should be installed to restore the path to ground across dielectric connections.