Neonatal abstinence syndrome (NAS) occurs when a newborn is exposed to certain substances, particularly opioids, during pregnancy. When the mother uses these substances, the baby becomes dependent on them while in utero and experiences withdrawal symptoms after birth. Other substances that can contribute to NAS include benzodiazepines, alcohol, and certain antidepressants, with severity depending on the type and amount of substance used, as well as the timing of exposure during gestation.