Corticosteroids are primarily used to accelerate fetal lung maturation in cases of preterm labor. They help in reducing the incidence of respiratory distress syndrome (RDS), intraventricular hemorrhage (IVH), and necrotizing enterocolitis (NEC) in premature infants. This is critical because premature infants often lack sufficient surfactant in their lungs, making it difficult for them to breathe.