Why do cotton and wool shrink

Wool does not shrink, it felts. This is caused by the raised scales of the cuticle layer of the wool fiber catching on one another. The fibers in a fleece on a sheep are all growing out of the follicles in the same direction and they generally grow at a similar rate. This means that the cuticle scales (which are a bit like the teeth on a saw blade) are all pointed in the same direction. They don't catch on one another. These scales can be seen clearly under a microscope.

After the fleece is shorn, the processing stages cause the natural fibers alignment to be completely disrupted. As the fleece is cleaned and scoured, the "staple" structure is destroyed and the fibers no longer line up "tip to base" as they would in the fleece. The fibers end up in all dimensions and suffer entangling after scouring and drying. The purpose of washing and scouring is to remove unwanted materials and to disentangle and align the fibers into a parallel arrangement for spinning yarn. However the fibers will not necessarily be "tip to base". The scales now can be at 180 degrees to one another, which can cause them to catch on each other.

When the fibers are spun, they come in close contact with each other, and the interlocking nature of the scales is what helps keep the yarn together. Felting usually occurs in the presence of heat, water and agitation, and this acts as a ratchet, tightening the contact between the fibers in the yarn, and then the yarns in the fabric.

Wool tends to felt is because of the scales on the fibers. Other animal fibers have cuticle scales too, but to varying degrees. For instance, the cuticle scales on human hair are much flatter. Fine diameter wools are more likely to felt than broad diameter wools because they have a greater surface area, and hence more scales proportionately.

Shrink-proofing is a chemical treatment of wool, which uses chlorine to "burn" off the scales. This doesn't entirely remove them, but it does lessen their profile. The fibers are then coated with a resin to smooth them further. This allows the wool to be machine washed without felting / shrinkage.