The organs are far from sterile, whole pathways are very close, there is a lot of pushing beyond control which uses sort of same muscles... it doesn't mean every natural baby is born with big poop on their head (mine weren't), but these transfers do happen. You don't need that many bacteria to make it work, infant's intestines are a sterile place at the beginning so not much competition and food for them starts coming soon.