One of the first ways that a newborn is exposed to new microbes is through its own childbirth. Children delivered by vaginal births have similar microbiomes to their mothers vaginal flora while newborns that are delivered by cesarean section have similar microbiomes to the mothers skin surfaces.
Another very important factor contributing to infants microbiomes is their diet. Whether a newborn is breastfed or fed by formula will contribute to different microbes. Bifidobacterium, Bacteroides, Streptococcus, and Lactobacillus are all common to find in infants that are breastfed. While those that are fed by formula tend to have more Staphylococcus, anaerobic Streptococcus, Clostridium, and Bifidobacterium.