In recent years, the number of scientific publications on the role of intestinal microbiota in shaping human health, as well as the occurrence of intestinal dysbiosis in various disease entities, has increased dynamically. However, there is a gap in comprehensively understanding the factors influencing a child’s gut microbiota. This review discusses the establishment of gut microbiota and the immunological mechanisms regulating children’s microbiota, emphasising the importance of prioritising the development of appropriate gut microbiota in a child from the planning stages of pregnancy. The databases PubMed, Web of Sciences, Cochrane, Scopus and Google Scholar were searched to identify relevant articles. A child’s gut microbiota composition is influenced by numerous factors, such as diet during pregnancy, antibiotic therapy, the mother’s vaginal microbiota, delivery method, and, later, feeding method and environmental factors. During pregnancy, the foetus naturally acquires bacterial strains from the mother through the placenta, thereby shaping the newborn’s immune system. Inappropriate maternal vaginal microbiota may increase the risk of preterm birth. Formula-fed infants typically exhibit a more diverse microbiota than their breastfed counterparts. These factors, among others, shape the maturation of the child’s immune system, impacting the production of IgA antibodies that are central to cellular humoral immune defence. Further research should focus on identifying specific microbiota–immune system interactions influencing a child’s immune health and developing personalised treatment strategies for immune-related disorders.