Surfactant deficiency occurs when there is an insufficient production of surfactant in the lungs, leading to increased surface tension and collapse of alveoli, which impairs gas exchange. This condition is most commonly seen in premature infants and can result in respiratory distress syndrome, necessitating medical intervention such as surfactant replacement therapy.