Steel boats and many other iron or steel things are painted. The chief reason for painting them is not to make them look more attractive, though, of course, that is one reason. The chief purpose is to protect the metal surfaces from oxygen and moisture in the air, and thus to prevent their rusting.
Paint protects the surfaces of wooden houses and fences by covering them so that the small plants and animals that cause decay cannot get at the wood.
Paint consists of a colored powder, called a pigment, mixed with oil, usually linseed oil. The oil oxidizes, and makes a tough film, which is a thin covering for the surface. The pigment (1) furnishes color; (2) provides body for the oil film; and (3) makes the oxidation of the oil take place more rapidly.