The role of the immune system is to protect the body from illness and fend off unwanted pathogens and bacteria.
The immune system is particularly interconnected with gut bacteria. Most of the human microbiota resides in the gut, and so does 70-80% of the body’s immune system.
The gut and the immune system support one another to promote a healthy body. For instance, the gut microbiome acts as a gatekeeper and a trainer. It teaches immune cells called T-cells to distinguish foreign entities from our own tissue.
It is important to maintain a powerful immune system and proper communication with the gut. When everything is running smoothly, the gut sends signals for the development of healthy immune function modulating immune responses. In exchange, the immune system helps to populate the microbiome with health-promoting microbes.
When the gut becomes unbalanced with unhealthy levels of certain bacteria, probiotics can help restore the balance. They've been shown to secrete protective substances, which may turn on the immune system and prevent pathogens from taking hold and creating major disease.
Reference:
Belkaid, Y., & Hand, T. W. (2014). Role of the microbiota in immunity and inflammation. Cell, 157(1), 121-141.