The electrons are released to the metal and lead to a potential (measured in Volts) that can be measured with respect to the standard hydrogen ion reaction.
Different metals have different potentials, and their mutual ordering on the Electrochemical Series determines whether a particular metal will act as the anode (i.e. corrode) or act as the cathode. The more negative the potential, the more likely the metal is to corrode.