Air bags contain the chemical compound sodium azide, which has the formula NaN3. When heated, sodium azide will decompose to produce Nitrogen gas, as follows:
2 NaN3 `->` 2 Na + 3 N2
Approximately 70 L of nitrogen gas is produced from about 130g of sodium azide and this is what inflates the air bag. The reaction is initiated by an igniter in response to forces detected by sensors on the car.
Airbags also contain some KNO3. In a second reaction it reacts with the sodium metal from the first reaction to produce Na2O and K2O and some additional N2. This removes the harmful Na metal before the airbag contacts the occupant of the car. In a third reaction, SiO2 that was also contained in the reaction chamber of the air bag reacts with the Na2O and K2O to produce more stable alkaline silicate glass, which is safer than the alkali oxides.
All three of these reactions happen in a fraction of a second.