The gut microbiomes during pregnancy and infancy play a critical role in maternal and infant health, yet our understanding of what determines their temporal dynamics, interactions, and health impacts remains poor. In this study, we profiled 4,577 longitudinal fecal samples from 714 mother-infant pairs in the Dutch birth cohort LLNEXT, from 12 weeks of pregnancy to one year postpartum. Hospital records and questionnaires were longitudinally evaluated to assess 474 clinical, dietary, and exposure variables, and 24 human milk oligosaccharides were measured in breast milk. We observe that the maternal gut microbiome undergoes subtle changes during pregnancy and postpartum and is influenced by dietary preferences, infections, and pre-pregnancy smoking history. We also observe evidence for substantial mother-to-infant gut microbial strain transmission, with many species exhibiting time-dependent strain-sharing, where higher maternal abundances of specific species increased the likelihood of strain transmission. Notably, we find that maternal gut microbial diversity before birth is the strongest predictor of infant eczema, surpassing family history as a predictive factor. The primary factors shaping the infant gut microbiome are mode of delivery and infant feeding with additional factors like maternal pre-pregnancy smoking, and parity associated with individual species. Of 585 vaginally delivered babies, 155 were born at home, but home delivery showed only a moderate association with microbiome composition, similar to other birth parameters like duration of active pushing and ruptured membranes. While the infant microbiome at 2 weeks was often largely dominated by single bacteria, its composition did not predict later microbiome or health outcomes (up to 12 months of age), suggesting that early-life gut colonizers are not deterministic for later-life microbial communities and health. Overall, we uncover patterns of microbial dynamics during pregnancy, transmission, and early-life microbiome development, providing insights and data for future microbiome-targeted therapies.