Cavitation happens when, in some points, the liquid's pressure becomes lower than the liquid'd vapour pressure. The liquid boils and a bubble of vapour forms. When the pressure raises the vapour bubble collapses and strong shockwaves are generated. It is a phenomenon that needs a state change to exists that's why it only exists for liquids.