Hairspray is made from long molecules called polymers that are suspended in a solvent, typically alcohol or hydrocarbons, and packaged into a pressurized can. When this solution is sprayed on hair, the solvent evaporates, which allows the polymers to link together, forming a hard surface.
Typically, the polymers in hairspray are suspended in solvents of alcohol or hydrocarbons. These compounds are highly flammable but are thought to result in less damage to the ozone layer than more traditional organic solvents. Some types of polymers used are very similar to those found in types of wood glue, although other types of polymers are also used to increase the time that the hairspray lasts or to reduce the environmental impact of the hairspray by using naturally sourced polymers.
This solution of polymers and solvent is packaged into a sealed metal can. The can is then pumped full of a volatile gas, called a propellant, which pushes down the liquid hairspray and creates a highly pressurized environment. When the nozzle is depressed, the can is opened to the environment, and the pressure inside the can is relieved. This causes the gas propellant to push up on the hairspray, spraying it into the air through a very small opening.
Liquid propellant can also be used in an aerosol can. When the hairspray is dispensed and the pressure inside the can is reduced, liquid propellant converts into gas and similarly pushes the hairspray into the air.