When a metal is attacked by water, air or acids in their environment, they corrode. Corrosion results in the metal become weaker and brittle.
The corrosion of iron and steel is specifically called rusting due to the red-brown substance called rust that forms in the presence of water and oxygen.
The experiment below shows that an iron nail only rusts if both water and oxygen are present:
1. Paint or grease
This prevents water or oxygen reaching the iron. However, this is only a temporary step since paint can flake off and grease can be rubbed off quite easily. Bikes are often painted of greased to prevent rust, since this is the cheapest method of prevention.
Plastic is cheap and acts as a cover for the iron, for instance, it stops water or oxygen reaching the metal surface. Garden chairs are often made from iron coated in plastic.
This involves the iron been covered, usually in the form of a paint, by zinc. Since zinc is more reactive than iron, air and water react with the zinc rather than the iron. Outside structures, such as bridges are often galvanised.
4. Chromium plating
Works for the same reason as galvanising. Chromium is a more reactive metal than iron. Car bumpers are often chrome-plated.
Both chromium plating and galvanising are examples of sacrificial protection. Zinc and chromium are sacrificed for the iron.