Surface tension is the tendency of liquid surfaces at rest to shrink into the minimum surface area possible. When the brush is in water, the spaces between hairs are filled. When taken out, a film of water remains between the hairs. The surface tension of this water film causes it to contract, pulling the individual hairs closer together.