Fetuses have some bacteria while still in the womb, but during birth they're coated with microbes as they travel down the birth canal, including bacteria that help newborns digest their first meal.
See All 1944 Episodes of "A Moment of Science"