What is happening?
For iron to rust, water and oxygen are normally involved. Different areas on the metal surface can act as tiny electrochemical sites where iron is oxidised and oxygen is reduced. The products evolve into hydrated iron oxides and related compounds we call rust.
Where do we see it?
Salt can accelerate corrosion because dissolved ions make water conduct electricity better. Acidity, temperature and contact with other metals can also change the rate.
Protection can work in several ways: paint blocks water and oxygen, zinc coatings can protect steel, and stainless steel relies on chromium to form a thin passive surface layer.