The fire triangle consists of heat, fuel, and oxygen, as also stated by LRonHoover.Putting water onfire cools the temperature of the fuelwhich takes the heat part out the triangle and you have no more fire.
Because water is the product of burned hydrogen. So you can think of it as already being burned and can't be burned any further and therefore smothers the fire.
The cooling effect eliminates the fire.Dry chemical smothers the fire and is used in situations like gas turbine power plants.Then there'sAFF, aqueous film forming foam.The AFF lays a barrier over the fire so oxygen can't reach it, also eliminates vapors from fuels, such as gas and jet fuel, from re-igniting in the air.CO2 can also be used as it eliminates oxygen and smothers the fire, but it has to be used in a situation that can be made airtight.The same with a chemical called Halon, which isn't enviromently safe so it has been replaced with a chemical called FM200.Also has to be used in a situation that can be made airtight,i.e, fur vaults,computer rooms, electrical vaultsand vaults storing cold hard cash.