Iron articles are painted to prevent rusting. When left unpainted, the metal surface comes in contact with atmospheric oxygen, and in the presence of moisture, it forms iron (III) oxide. When painted, the surface does not come in contact with moisture and air. Thus, it prevents rusting.