Resident microflora begin to develop at and following birth. During a normal, healthy pregnancy, the womb is essentially axenic and microbes that might be present in the mother's body are shielded from the mother by the placental barrier.
At birth, the infant passes through the birth canal, coming in contact with microbes for the first time. After about two weeks, the infant has developed normal microflora in the gastrointestinal tract. Other microbes that ultimately become part of the normal microflora are gained from exposure to air, horizontal transfer from other people and from food and drink.