The microbiome for the baby comes from the mother as it passes through the birth canal or in the case c-section to a lesser degree via breast feeding - bootstrapping us for healthy digestive tract.
Of note - it is common for mothers to receive antibiotics during delivery for a great many reasons. This can delay the development of the gut microbiome in babies, and is potentially linked to colic.
In some c-section cases they’ll perform “vaginal seeding”, wherein the microbiome from the mother’s vaginal canal is swabbed onto the face, mouth, etc. of the newborn.