Respiratory distress syndrome (RDS) primarily occurs due to a deficiency of surfactant, a substance that helps keep the alveoli in the lungs open, leading to respiratory failure. In infants, particularly premature ones, RDS is common as their lungs may not be fully developed. In adults, it can result from trauma, pneumonia, sepsis, or exposure to harmful substances, which can lead to acute respiratory distress syndrome (ARDS). Other contributing factors may include genetic predispositions and underlying health conditions affecting lung function.