There are two air functions in air brakes. One is the service brake (the pedal) that applies air pressure to apply braking pressure. The second is a spring-operated parking brake which uses air pressure to remove it.
When you activate the parking brake, you are dumping the air allowing the spring to lock the brakes. If you lose air pressure, that function automatically activates. If you start losing pressure, an alarm sounds to warn you of impending death. Usually it warns you with enough time to stop before you lose enough air to lock up the brakes. Nothing makes your heart flutter more than going down hill on the highway with 80,000 lbs behind you and hearing that alarm go off. It's rare, but it happened to me once. Barely got stopped before the parking brake popped on.