There is a valve in fetal heart that diverts blood away from the lungs while in utero. It begins closing as the baby takes its first breath after being born and gets oxygen from its own lungs for the first time.