The water absorbs some of the heat that is released and flashes into steam, keeping the overall temperature down but still using the heat to build pressure in the chamber, so the power is still there without the dangerous high temp.
Remember that the sole purpose of burning gasoline and oxygen is to heat up the inert part of the mixture (nitrogen) along with the waste gases and make pressure in the cylinder to push on the piston. Using the heat released during the burn more efficiently (quickly and at the right time) makes more power. The higher the temperature, the more pressure can be made ( Boyle's Law) but past a certain point (2500 F) other things start to happen. Heat (energy) that is absorbed by converting nitrogen and oxygen to nitrogen oxides is wasted as is pressure that peaks too soon, too late or too slow.
Water injection was de rigueur on the crude turbo systems of the time. Fortunately the car companies solved most of the problems for us with fuel injection and electronic spark control. Intercoolers also helped!