Human milk oligosaccharides (HMOs) are the third most abundant nutrients in human milk, following lactose and fats, playing an irreplaceable role in nutritional regulation during the growth and development of newborns, the establishment of the immune system, and the modulation of the gut microbiota. This article reviewed the structural characteristics, classification, and compositional variations of HMOs in human milk. It also explored the potential mechanisms by which HMOs influenced infant brain development through pathways such as modulating the gut microbiota and enhancing gut barrier function. The factors influencing the compositional changes of HMOs in human milk were analyzed in detail, including genetic factors, timing of delivery, geographical differences, maternal health, and lactation duration. This article elucidated how HMOs, through the bidirectional communication mechanism of the 'gut-brain axis', promoted the growth of beneficial bacteria, inhibited the proliferation of harmful bacteria, maintained gut microbiota homeostasis, enhanced gut barrier function, reduced pathogen invasion and the absorption of harmful substances, and simultaneously affected the synthesis and release of neurotransmitters, thereby indirectly or directly promoting infant brain development. In addition, this paper also explored the safety assessment of HMOs as food ingredients at the current stage and their application prospected in infant nutritional supplementation. This held significant importance for optimizing infant nutritional supplementation strategies and promoting the healthy growth of infants.