Cathodic protection prevents corrosion by converting all of the anodic (active) sites on the metal surface to cathodic (passive) sites by supplying electrical current (or free electrons) from an alternate source.
Usually this takes the form of galvanic anodes, which are more active than steel. This practice is also referred to as a sacrificial system, since the galvanic anodes sacrifice themselves to protect the structural steel or pipeline from corrosion.