All metals are subject to the oxidation reaction,
M Mm+ + m e-
where M is a resident metal atom, M+ is a metal ion released to the electrolyte, and e- is an electron.
For example, copper or nickel can oxidize to release 2 electrons each, and magnesium can oxidize to release 1 electron:
|Oxidized Metal||Reaction|| Potential
|Copper:||Cu||Cu2+ + 2 e-||0.3419|
|Nickel:||Ni||Ni2+ + 2 e-||-0.257|
|Magnesium:||Mg||Mg+ + e-||-2.7|
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.