The baby's lung does not function to deliver oxygen while it is in mom. Instead, mom delivers oxygen to the baby through the placenta. The blood of the mom and baby do not mix, just the oxygen transfers. Therefore, the health of the placenta before birth and during labor is very important. During labor, there is a temporary interruption of blood flow to the placenta during each contraction. Normally, the baby and placenta adapt fine to this and it is well tolerated. I'll go into more detail about what may cause problems in anther post.
Obstetrics: Normal and Problem Pregnancies, 5th ed. Gabbe et al.
Fanaroff and Martin's Neonatal-Perinatal Medicine, 8th ed. Martin et al.