During pregnancy, the cervix is tightly closed to help keep the baby inside the uterus. During childbirth, the cervix opens to allow the baby to pass through the vagina.