Oxygen is carried through the blood. The mothers blood flows to the baby and gives them oxygen from the mother. A baby doesn't take its first breath of air until it is born. That is why a mother shouldn't smoke while she is pregnant. It decreases the amount of oxygen to the baby.
Through the umbilical cord that's hooked to the mother's blood supply via the placenta.