it’s all about fiber, temperature and agitation.
First, when cotton, linen and some synthetic fabrics are made, their fibers are pulled, stretched, twisted and stressed. Washing and drying these fabrics lets the fibers relax, returning them to their pre-shrunken state. However, wool and other animal fibers are actually hairs covered in microscopic scales that snag one another when processed into fabric.
Washing these fabrics too vigorously can cause the scales to tighten together even more, making the garment shrink or even felt into a solid piece. Luckily, learning how to avoid shrinking clothes isn’t complicated.