There’s a small computer under the hood or behind the dashboard. It uses sensors to monitor the speed of the car, the speed you want to achieve, and the throttle position.
In most air bags, the sensor triggers chemical reactions that produce nitrogen gas from chemical tablets stored in the unit. The gas whooshes into the bag and inflates it in only a few milliseconds.