A natural act that as the baby is born, the mother's intact perineum presses inward below the baby's ribcage causing mucous to be forced out of the baby's mouth and nose.
In this video you'll notice that the baby experiences a final rotation just prior to exiting the cervix. In live birth with a naturally or spontaneously ocurring labor the uterine muscles, including the cervix will maintain enough strength to gently squeeze under the infant sternum. This allows the baby to expel any amniotic fluid remaining in the mouth or esophagus. Please keep in mind that the cervix actually fits more tightly around the baby's head. Especially during the crowing stage of labor.