First let's examine what corrosion is. "In the most common use of the word, this means electrochemical oxidation of metal in reaction with an oxidant such as oxygen. Rusting, the formation of iron oxides, is a well-known example of electrochemical corrosion." from wiki
Keeping it simple, when you put a DC charge across the cathode and anode you are polarizing the cathode thereby making it a more negative. Since there are more electrons at the cathode it will push the electrochemical process so that it protects the cathode from corroding and induces the anode to corrode in its place. The net electochemical pressure maintained by the DC current will push the oxidation reaction to take place at the sacrificial anode. The positive ions for ex. H+ will move to the cathode and the negative ions will move towards the anode. If all is working as planned the 2H+ + 2 electrons will bubble off at the cathode as H2 gas protecting the cathode and the Oxygen neg ion will Oxidize the Anode (the more reactive metal). The DC current insures this is the preferred Oxidation reaction. Keeping in mind both of the metals of the cathode or anode could have been oxidized overtime as is the case in a pipeline. The net is the DC current is a balancer or (EM)force to insure the intended metal is sacrificed.