Corticosteroids enhance the production of surfactant, a substance that reduces surface tension in the lungs, thereby preventing alveolar collapse. They also promote the maturation of various fetal organs, including the lungs, brain, and intestines, which are crucial for survival outside the womb.