The rust of iron is mainly caused by air oxidation and electrochemical corrosion. Due to the oxidation reaction with oxygen in the air, metal oxide, namely rust, is formed on the surface. If there are many impurities in the metal, these impurities will form chemical primary cells with the metal, and electrochemical corrosion will occur, thus oxidizing the metal into metal oxides.
2Fe+O2+2H2O=2Fe(OH)2
4Fe(OH)2+O2+2H2O=4Fe(OH)3
2Fe(OH)3=Fe2O3+3H2O