Older water based extinguishers would contain slightly acidic water, and a small dry container at the top, containing a base. When you turned the extinguisher upside down, the base and acid would come into contact, exotherming and forming carbon dioxide, thus pressurizing the tank.
More modern extinguishers contain a small vial of compressed gas, often liquid CO2, which you puncture when you activate the handle, thus pressurizing the cylinder.