In a cathodic protection system designed to prevent steel underground tanks from corroding, a sacrificial anode is a bar of metal, usually made of magnesium or zinc and connected to the metal to be protected. As electric currents flow through the soil, around the tank, they tend to flow from the metal bar (the anode) to the tank (the cathode). The currents moving from the anode carry with them bits of metal. As a consequence, the anode gradually corrodes; it “sacrifices” itself, and thus protects the tank.

Were it not for the presence of the nearby magnesium or zinc anode, the tank itself would serve as an anode. Currents flowing away from it would carry with them bits of metal, causing the tank to corrode. 

See also Cathodic protection.