An airlock is a device which permits the passage of objects, people, etc between two areas of different air pressure without allowing the air with the higher pressure to escape. It simply consists of two airtight doors, which are never opened simultaneously. A small amount of air, equal to the volume of the chamber between the doors, is lost each time the airlock is operated.
An Airlock can also be used in brewing and is a simple 'S' shaped piece of plastic tubing that is half filled with water. When fitted into the top of a carboy by a rubber stopper the airlock allows waste carbon dioxide to escape while preventing outside air from bringing in bacteria that may spoil the batch. The positive pressure of the CO2 inside of the carboy pushes out individual bubbles of carbon dioxide through the water and out to the air.