How does a hot piece of metal and some steam turns my shirt fabric from supper wrinkly to nice looking and straight ?
For plant based fibers, it’s the cellulose. When cellulose is both wet and heated, it’s fibers weaken, and become pliable. When they dry back out, those fibers are molded into whatever shape they were in; and they regain their strength.
This is where wrinkles come from. the iron applies both heat and moisture through the steam to momentarily soften the fibers, and the flat plate and weight of the iron creates a smooth, flat shape as the heat dries them out.
Fabric is - as you know - not made out of a continuous material but rather fibres. These fibers allow for movement up to the point were the network is in tension. This tension is the result of bonds. While the fibre itself relies on covalent bonds of extreme strength the bonds between different fibres are way way weaker. So weak that they “feel” temperature. Also a polar solvent like water weakens these bonds significantly. If you iron fabric while it is laying flat, the fibres rearrange to minimise tension. The new arrangement hardens out while cooling. The new arrangement prefers a flat structure. That way it looks flat on your body.