The pipelines under the surface of earth are protected from corrosion by connecting them to a more reactive metal Mg or Zn which is buried in the earth and connected to the pipelines by wire.Can't
When iron is coated in zinc , the process is called galvanising. The zinc layer stops oxygen/water from attacking the iron. While zinc is more reactive than iron, it still offers a physical barrier but also provides chemical protection.
Zinc Rich or Magnesium Rich Paints act as sacrificial anodes and prevents corrosion by reacting themselves first, in the place of iron or steel. They are also called Cathodic Protection coatings.
One type of cathodic protection system is the sacrificial anode. The anode is made from a metal alloy with a more "active" voltage (more negative electrochemical potential) than the metal of the structure it is protecting (the cathode). ... Sacrificial anodes generally come in three metals: magnesium, aluminum, and zinc.