surfactant
Surfactant is a soapy film that coats the inside of the alveoli and keeps them from collapsing. Just as dish soap makes water spread thin instead of beading up, surfactant breaks the strong pull of water at the alveolar surface so the tiny air sacs stay open and easy to inflate.
The alveoli are lined with a thin layer of fluid, and water molecules at any air–liquid surface pull together — surface tension — which would tend to crush small bubbles shut. Surfactant, a mix of phospholipids and proteins made by type II pneumocytes, sits in this film and lowers that tension dramatically.
Cleverly, surfactant lowers surface tension more in small alveoli than in large ones, because its molecules pack more tightly as an alveolus shrinks. This stabilises the lung: it stops small alveoli from emptying into larger neighbours and prevents patchy collapse.
Surfactant first appears late in fetal development. Premature babies born before it is plentiful suffer neonatal respiratory distress syndrome, with stiff, collapsing lungs; replacement surfactant given into the airway is a life-saving treatment. It also lowers the work of breathing and contributes to lung immune defence.
A baby born at 28 weeks may need surfactant instilled through a breathing tube within hours of birth, after which the stiff lungs often inflate far more easily.
Replacement surfactant treats neonatal RDS.
By the law of Laplace, the pressure tending to collapse a bubble rises as its radius falls. Without surfactant, small alveoli would have higher collapsing pressure than large ones and empty into them; surfactant's size-dependent action neutralises this instability.