Rusting is, in the simplest term, the slow eating away of iron and its alloys. Rusting is the same as corrosion, but it is used to describe the corrosion of iron and its alloys only. Rusting is a chemical process in which ferrous (Fe(II)) reacts with oxygen in the presence of moisture (or water), to produce ferric (Fe(III)) oxides and hydroxides (which are called rust). Rusting causes slow degradation of iron and its alloys. This results in the weakening of the material and ultimate failure. Since iron and its alloys are very widely used (some examples are pipelines for water and wastewater flow; structures like bridges; railway tracks; ships; etc.), any degradation in the metal's quality will directly affect these structures, our economy, and our health and well-being. And thus the prevention of rusting is necessary. There are a number of ways of doing it, such as galvanization, paints, coating, etc.
Hope this helps.