Spontaneous corrosion of metals requires the presence of two processes: anodic and cathodic reactions.
The animation below shows metal dissolution at low pH, where the cathodic reaction is hydrogen evolution. At the anode metal atoms (blue) ionize and the metal ions move into the electrolyte. Released electrons (red) move through the metal to the cathode. Here hydrogen ions (pink) take up the electrons, sit adsorbed on the surface as atomic hydrogen before combining into hydrogen molecules and dispersing.
The anodic process can be the metal dissolution, i.e. M --> Mn+ + ne-, or some other oxidation reaction. The electrons produced in the anodic reaction are consumed by the cathodic process. The rate of electron generation must match that of electron consumption, i.e. there is no net build-up of electrons in the metal.
The corroding metal attains a corrosion potential Ecorr, somewhere between the equilibrium potentials of the anodic and cathodic processes. The rate of the corrosion reaction depends not just on the magnitude of the driving force (the difference between the two equilibrium potentials), but also on the kinetics of the anodic and cathodic processes.
In natural aqueous environments hydrogen evolution and oxygen reduction are the most common cathodic processes. In other environments other reactions may occur.
Hydrogen evolution (2H+ + 2e- --> H2) predominates in acid conditions. The equilibrium potential of hydrogen evolution depends on the pH of the solution (-0.059pH). The exchange current density of the reaction depends on the nature and composition of the metal substrate.
Oxygen reduction (O2 + 2H2O + 4e- --> 4OH-) predominates in neutral and alkaline solutions. The driving force again depends on the pH but is much greater than that of the hydrogen evolution reaction (equilibrium potential is 1.228 - 0.059pH). However the kinetics of the reaction are much slower, as a result of a lower exchange current density and of mass transfer limitations.
The sites of the anodic and cathodic processes may be microscopically adjacent or they may be some distance apart. An electrically conductive path must however exist between the sites, electronically conductive path via the metal and ionically conductive path through the electrolyte. The actual areas of the anodic and cathodic sites also matter, since it is the current density (number of electrons generated per unit area per unit time) that controls the dissolution rate.
If the corrosion current density can be determined, then it is simple to calculate the corrosion (or penetration) rate using Faraday's law.
Under freely corroding conditions the anodic and cathodic currents (not current densities !) are equal (but opposite in polarity) and the corrosion potential attains a level at which this equality occurs (both the anodic and cathodic reactions are polarised from their equilibrium values towards this potential). Unfortunately, the corrosion current cannot be measured directly and a few tricks have to be resorted to.