Magnesium powder burns extremely well and reaches temperatures of 2500°C. However, attempts to extinguish such a magnesium fire with conventional water (e.g. from a garden hose) only make it worse: the flame grows astronomically and the whole thing gets even hotter. Why is this?
Magnesium reacts with water to produce hydrogen and a lot of heat. Metallic magnesium reacts only slowly, but magnesium vapour, produced when Mg burns, reacts extremely quickly due to the high temperature and efficient mixing, and produces heat very rapidly. Hence the explosion when water is added to burning magnesium.
The total energy released per gram of magnesium stays the same:
$$\rm Mg+O_2 \to MgO_2$$ is identical in overall effect to the pair of reactions $$\rm Mg+2H_2O\to MgO_2+2H_2$$ $$\rm2H_2+O_2\to2H_2O$$
Water is consumed and produced in exactly the same amounts; hydrogen is produced and consumed in exactly the same amounts
Liquid water makes more oxygen available to the magnesium; the hydrogen gas can mix with the oxygen in the air more quickly.
You could get the same effect by grinding the magnesium into a fine powder and blowing it into the air.