The rapid inflation of an airbag is caused by the generation of a large volume of gas from a chemical reaction triggered by impact. Sodium azide decomposing to nitrogen gas is the basis of this process.