The lung is held close to chest wall because of the negative pressure in the pleural space. Once the negative pressure is lost the lung tends to recoil due to elastic properties and becomes atelectatic. This occurs in patients with pneumothorax and pleural effusion.
The following reveals a pneumothorax. In this instance, the loss of negative pressure in the pleura permits lung to relax, due to elastic recoil. There is a common misconception that atelectasis is due to compression. I disagree with that concept as is in Textbooks.