The magic?
At birth, the baby's lungs are filled with fluid. They are not inflated. The baby takes the first breath within about 10 seconds after delivery. This breath sounds like a gasp, as the newborn's central nervous system reacts to the sudden change in temperature and environment.
Once the baby takes the first breath, a number of changes occur in the infant's lungs and circulatory system:
• Increased oxygen in the lungs causes a decrease in blood flow resistance to the lungs.
• Blood flow resistance of the baby's blood vessels also increases.
• Fluid drains or is absorbed from the respiratory system.
• The lungs inflate and begin working on their own, moving oxygen into the bloodstream and removing carbon dioxide by breathing out (exhalation).
BODY TEMPERATURE
After delivery, the newborn begins to lose heat. Receptors on the baby's skin send messages to the brain that the baby's body is cold. The baby's body creates heat by burning stores of brown fat, a type of fat found only in fetuses and newborns. Newborns are rarely seen to shiver.
LIVER
When the baby is born, the liver has various functions:
• It produces substances that help the blood to clot.
• It begins breaking down waste products such as excess red blood cells.
• It produces a protein that helps break down bilirubin. If the baby's body does not properly break down bilirubin, it can lead to newborn jaundice.
GASTROINTESTINAL TRACT
A baby's gastrointestinal system doesn't fully function until after birth.
URINARY SYSTEM
…After birth, the newborn will usually urinate within the first 24 hours of life. The kidneys become able to maintain the body's fluid and electrolyte balance.
Changes in the newborn at birth: MedlinePlus Medical Encyclopedia
At that magic moment the fetus ends its complete dependence on the mother and functions as a separate person able to maintain all bodily function by itself and acquires legal rights commensurate with its age.