Cavitation is the nucleation of bubbles from decreased pressure in a material, typically a liquid.
To understand why cavitation occurs, we can look to the phase diagram of water - the figure below. If the water is at room temperature and pressure it will be in the liquid state as marked as by the black circle. If the temperature is raised, the water will be move horizontally along the phase diagram as shown in green and at its boiling point (212oF) it will boil and become gas. Alternatively, if the pressure is reduced, the red line will be followed, and the water will turn to gas again via cavitation. Now we see, boiling is the phase change to gas by increasing temperature and cavitation is the phase change to gas by reducing pressure.
I find this quick video very interesting .