Why do clothes get stiff when you air-dry them?
The actual mechanism for textiles becoming stiff has been put down to multiple causes over the years but is now generally agreed to be largely a characteristic of the fibres themselves “sticking” to each other at the molecular level as they dry, which can then be made worse by limescale residue (hard water) and soap residue reinforcing these bonds.
Line drying outside (in windy or moving air), tumble drying, or just using/wearing the clothes prevents these links forming or breaks these links by continuous mechanical agitation. Ironing uses heat and pressure to break these bonds, and if steam is also present then it breaks the bonds by briefly re-wetting the fibres and letting them “re-stick” in a flat and aligned position.
Fabric softeners help prevent the stiffness forming by coating the fibres with a light oil, or in some cases by inducing a small static charge that causes the fibres to repel as they dry (cf your hair standing on end).
Personally I dislike fabric softener so use vinegar in its place during the rinse as this helps get rid of soap residue and it combats limescale, and I’ll then at least briefly tumble most clothes even if I then line dry them indoors.
Water causes settlement and compaction, whether it be in dirt or fibers of laundry, ei. The layers stick closer together and become stronger or tighter. The tumble undoes this phenomenon.
The water you wash your clothes in have minerals in it. Letting it air dry leaves the minerals behind to harden in the position the clothes are in. Drying it in the dryer tumbles the clothes which breaks up the minerals leaving the clothes soft.