Like smoofers said, cavitation occurs when you do not have enough inlet pressure to fill the void left by the spinning pump element as it goes by. The pressure required on the inlet is sometimes referred to Gear Tip Velocity Head (GTVH). It is essentially dependent on the pump diameter and rotational speed. The greater the pump diameter and/or the greater the rotational speed, the more pressure you need on the inlet to the pump to fill the pump and prevent cavitation. At higher watercraft speeds the inlet pressure is generally higher, so at a given rpm, at a higher craft speed, you fill the pump better. Also you will find a loader intake grade will help with cavitation – because it will increase the pump intake pressure.
How air enters the pump also can play a role. An air leak, drawing in air under vacuum on the inlet will act very much like cavitation. With larger air leaks, not only do you lose inlet pressure on the pump (which causes a harder time to fill the pump), but you are also introducing air (under vacuum) right into the pump. These vacuum bubbles will implode when the reach the high pressure side of the pump. The higher the outlet pressure of the pump is, the more severe the implosion. A higher pressure collapses the vacuum bubble much faster.
Now on the contrary, if the pump is just gulping air (like the pump is out of the water), you are dealing with air ingestion. Air coming into the pump at atmospheric pressure will compress on the outlet. It does not damage components like an imploding vacuum bubble.
Cavitation damage can be pretty crazy. I had a stock superjet aluminum impeller almost eaten through near the root on all three blades. Around the edges it was eroded somewhat, but then on the blade surface just looked frosted from the pitting. Obviously the aluminum impeller didn’t help the situation being so soft.