The common fire needs four things to burn.
Fuel
Oxygen
Heat
And an uninterrupted chemical reaction.
You put enough of each of those into the equation, and you get fire.
Take out enough of one of them, no fire.
Water reduces heat, and displaces the oxygen. It separates the fuel and disturbs the uninterrupted chemical reaction.
https://en.wikipedia.org/wiki/Fire_triangle
Latest Answers