From the archives of All things Ironing - Ironing chemistry.
When a fabric is heated, the molecules of the cotton fibres are more easily reoriented. In the case of cotton fibres, which are derivatives of cellulose, the hydroxyl groups that crosslink the cellulose polymer chains are reformed at high temperatures, and become "locked in place" upon cooling of the fabric.
Ironing works by loosening the bonds between the long-chain polymer molecules in the fibers of the material. While the molecules are hot and pliable, the fibers are straightened by the weight of the iron, and they hold their new shape as they cool. Some fabrics, such as cotton, require the addition of water to loosen the intermolecular bonds.
Many modern fabrics (developed in or after the mid-twentieth century) are advertised as needing little or no ironing because chemical agents such as dimethylol ethylene urea are added as crosslinking agents to keep textile fibres stable.