Other than to increase its malleability, another reason for heating the metal is for heat treatment purposes. The metal can be hardened, tempered, normalized, annealed, case hardened, and subjected to other processes that change the crystalline structure of the steel to give it specific characteristics required for different uses. Only steel, not iron, can be heat treated, and generally speaking, the higher the carbon content of the steel, the more it can be hardened.
When working with steels, a blacksmith will heat the metal and then quench it in various liquids such as water or oil.
The purpose of quenching is to produce rapid cooling to generate specific microstructures in the metal. A quench from a bright red or orange heat generally results in steel that is hard and brittle, so a second process, called tempering, is usually done to increase the toughness of the piece and reduce its hardness.
Tempering involves heating the material to a specific temperature (lower than red heat) usually called "critical temperature" and judged for common steel by the temperature at which the metal looses its magnetic attraction. Sometimes it is quenched again after this heat.