This comprehensive review examines the impact of dietary patterns on gut microbiome composition and diversity from infancy to old age, linking these changes to age-related health outcomes. It investigates how the gut microbiome develops and changes across life stages, focusing on the influence of dietary factors. The review explores how early-life feeding practices, including breastfeeding and formula feeding, shape the infant gut microbiota and have lasting effects. In elderly individuals, alterations in the gut microbiome are associated with increased susceptibility to infections, chronic inflammation, metabolic disorders and cognitive decline. The critical role of diet in modulating the gut microbiome throughout life is emphasised, particularly the potential benefits of probiotics and fortified foods in promoting healthy ageing. By elucidating the mechanisms connecting food systems to gut health, this review provides insights into interventions that could enhance gut microbiome resilience and improve health outcomes across the lifespan.