MAS typically occurs when a baby is stressed during labor, leading to a bowel movement while still in the womb. The exact causes can vary, but stressors may include prolonged labor, fetal distress, or reduced oxygen supply. When the baby inhales the contaminated fluid, it can cause blockages in the airways and lung inflammation.