Capillarity refers to the depression or rise of a liquid in a small passage, such as the spaces in between towel fibers or openings in porous objects. Capillarity is caused by surface or interfacial forces.
Encyclopedia Britannica explains that when a thin tube is inserted in water, the water rises due to the forces of attraction between the walls of the tube and the molecules of water, as well as the attraction among the water molecules themselves. The forces of attraction balance the gravitational force of the column of water that rose to a specific height. Furthermore, the narrower the opening of the capillary tube, the higher the water rises.