A lump of cotton wool shrinks in water due to a phenomenon called capillary action or capillarity. Capillary action is the ability of a liquid to flow in narrow spaces or tubes without the assistance of, or even in opposition to, external forces like gravity. It occurs because of the intermolecular forces between the liquid molecules and the molecules of the solid material.
When cotton wool or any porous material is placed in water, the water molecules are attracted to the fibers of the cotton through a combination of adhesive and cohesive forces. Adhesive forces cause the water molecules to stick to the surface of the cotton fibers, and cohesive forces cause the water molecules to stick to each other, forming a continuous column of water within the fibers.
As the water molecules are drawn into the tiny spaces and gaps between the fibers of the cotton, they effectively push out the air that was initially occupying those spaces. This process of water being drawn into the small spaces creates a meniscus, which is a curved surface at the water-air interface. The capillary action continues until the cohesive forces between the water molecules are balanced by the resistance offered by the narrow passages in the cotton.
Since the cotton fibers are now filled with water, the overall size of the lump of cotton wool appears to shrink. However, the total volume of water and cotton remains the same; it's just that the cotton fibers are now saturated with water.
This phenomenon is useful in various contexts, such as the ability of plants to draw water from their roots to their leaves through capillary action, the function of paper towels in absorbing water, and many other practical applications in science and everyday life.