Surfactant deficiency is mainly caused by prematurity. The production of surfactant starts late in fetal development, around the 24th week of gestation, and sufficient levels are usually not reached until about the 35th week. Other factors such as genetic conditions, infections, and maternal diabetes can also affect surfactant production.