It doesn't completely make a person invulnerable but to some extent, yes, it strengthens immune system even after weaning. This can be lifelong. Charge it to the bacteria that has been cultivated in one's gut which may live until the person dies.
Of course, the healthier the gut, the stronger the immune system because gut wall is home to about 70 percent of our immunity cells.