A compartment separating areas of different environments, especially different air pressures, it is used for entry to and departure from a spacecraft. Used by astronauts, for waste disposal and for taking equipment and depositing satellites into space.
An air lock is used to decompress astronauts after suiting up in space suits, in preparation for extravehicular activity, and to recompress them on return to the habitable living spaces.
Check out this eye-opening article from NASA with their innovative air lock that can launch satellites into space.
What happens when an air lock goes wrong? It gets pretty hot inside a space suit rather quickly.
Watch this video. Emergency Training Averts Airlock Disaster on MIR
What happens if the lock opens? Will you be pulled into space at top speed? We have all seen the sci-fi movies where a character is jettisoned into space. Does this really happen?
Watch this video. Are Airlocks Actually Deadly?