A pneumothorax, or collapsed lung, occurs when a hole develops in part of the lung, allowing air to leak. Once the lung has a hole in it, it can deflate like a balloon. Air will leak into and fills up the space in the chest cavity that was previously occupied by the lung.