The chest cavity is. A closed space. Taking a breath changes the internal pressure to negative, and air isdrawn in through the trachea. If the chest wall is breeched, air is drawn in through the hole, or if the lung has weak point, the pressure equilibrium is lost, and the lung deflates, like a tire with a hole in it, and collapses. It can also occur if the trachea or bronchus is blocked.
Pneumothorax. Exactly what it sounds like. A lung "pops" and collapses under the pressure of air inside the chest cavity.
Air in wrong place. "collapsed lung" in tv dramas is a pneumothorax. Pneumothorax is an accumulation of air outside your lung but inside your chest/ribcage. It is commonly described as a "collapsed lung" because the air in this space displaces your lung and prevents complete expansion of your lung.