If you're having a baby, the best thing you can do is to supplement b. infantis, especially the robust strain from Evolve Biosystems[3]. The Hadza have more b. infantis[4] which kicks off a set of immune host interactions that have positive effects on inflammation during the critical period after birth[5].
"After around 3 years, the gut microbiota stabilises retaining relative proportions of taxa with adaptations to composition harder to impose,"[6] so I doubt it's diet as much as it is vertical transmission of the right kinds of bacteria that set the infants up for a lifetime of healthy immune response.
1. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5103657/
2. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6177445/
3. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7352178/
4. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC9894631/
5. https://www.sciencedirect.com/science/article/pii/S009286742...