Final answer:
Surfactant is the compound that prevents the lungs from collapsing.
Step-by-step explanation:
The compound that prevents the lungs from collapsing is Surfactant. Surfactant is a substance that reduces the surface tension in the airways, allowing for easier inflation of the lungs. It acts like a detergent, making it easier for the lungs to expand and preventing them from collapsing.