When there is a moderate to severe crash, a signal is sent from the Electronic Control Unit (ECU) to the inflator within the air bag module.
An igniter in the inflator starts a chemical reaction that produces a gas that fully inflates the air bag within the blink of an eye, less than 1/20th of a second.
The gas is typically nitrogen or argon and is harmless.
Side-impact air bags inflate even more quickly since there is less space between the occupant and the striking object, such as another vehicle, a tree or a pole.
Because air bags deploy very rapidly, serious or sometimes fatal injuries can occur if the occupant is too close to, or is in direct contact with, the air bag when it first begins to deploy.
Nontoxic cornstarch or talcum powder is often used to aid air bag deployment. It is the "smoke" you may have seen released into a vehicle's interior in demonstrations.