The combustible material is cooled by water to bring its temperature below the ignition point. As a result, fuel cannot be ignited. As a result, the fire does not spread.
The air supply is shut off by the water vapour created by the heat of the fire. As a result of the lack of oxygen, the fire goes out.