The conversation between the immune system and the microbiome starts when our bodies first come in contact with microbes, at birth, though the is some evidence that it occurs in the womb.
The gut microbiome contains a vast array of species and lineages.
Our bodies are well adapted to hosting so many guests. Rather than just tolerating their presence, our bodies have a mutually beneficial relationship with most of our gut microbes. The biological terms for this relationship are symbiosis, and in more intimate individualised relationships, mutualism.