Clothes shrink because of the chemical and physical properties of fibers from natural sources, especially cotton, wool and linen.
The individual fibers in yarns are made of long polymer chains, or strands of giant molecules.
In their natural state, the chains are scrolled up or crinkled.
In preparing them for spinning and weaving, the first step is usually a straightening of the fibers by processes like carding wool.
However, the fibers try to go back to their natural state.
Moving from one state to another requires crossing an energy barrier. It even takes energy to get back to the lowest-energy, most disordered state.
Hot temperatures in laundering give the fibers the energy that allows them to change state so that the long polymer chains scroll back up again.
There is little shrinkage in synthetic fibers, because their polymers can be designed the way the makers want, and they start off in a straightened state.