It is well known that when in an accident your airbag will usually deploy. The use of an airbag is to slow your forward motion, lighten the blow of hitting the interior of your car and expand the square footage of the impact. Not everyone knows how that works or how useful an airbag really is.
Popular Science explains here exactly what triggers that inflation:
“The accelerometer keeps track of how quickly the speed of your vehicle is changing. When your car hits another car—or wall or telephone pole or deer—the accelerometer triggers the circuit. The circuit then sends an electrical current through the heating element, which is kind of like the ones in your toaster, except it heats up a whole lot quicker.This ignites the charge, often solid pellets of sodium azide (NaN3), which explodes. The explosion produces nitrogen gas (N2~) that fills the deflated nylon airbag (packed in your steering column, dashboard or car door) at about 200 miles per hour. The whole reaction takes a mere 1/25 of a second.”
The idea is actually that the airbag will be deflating by the time your head hits it.
According to National Highway Traffic Safety Administration frontal air bags have saved around 50,457 lives from 1987 to 2017. These numbers will continue to grow as long as you are sitting back in your seat and wearing your seatbelt!