Water Fire Extinguishers
Water is the most common chemical for class A fires and is quite effective as one would imagine. Water has a great effect on cooling the fuel surfaces and thereby reducing the pyrolysis rate of the fuel. The gaseous effect is minor for extinguishers, but water fog nozzles used by fire brigades creates water droplets small enough to be able to extinguish flaming gases as well. The smaller the droplets, the better the gaseous effect.
Most water based extinguishers also contain traces of other chemicals to prevent the extinguisher rusting. Some also contain wetting agents which help the water penetrate deep into the burning material and cling better to steep surfaces.
Regarding class B fires, water may or may not help extinguishing it. It depends on whether or not the liquid's molecules are polar molecules. If the liquid that is burning is polar (such as alcohol), there won't be any problem. If the liquid is nonpolar (such as large hydrocarbons, like petroleum), the water will merely spread the flames around.
Similarly, water sprayed on an electrical fire (US: Class C, UK: Class E) will probably cause the operator to receive an electric shock. (However, if the power can be reliably disconnected and a carbon dioxide or halon extinguisher is not available, clean water will actually cause less damage to electrical equipment than will either foam or dry powders.)