The huge surface area of your digestive tube must be protected against injury from bad bacteria, viruses, parasites, and other toxins that may get into the digestive system with food or by any number of other routes. The immune system is critically important in helping the intestines respond to these challenges.
Possibly the greatest challenge to the digestive tract's immune system is to correctly tell the difference between what is bad (such as viruses and bad bacteria) and what is good (such as nutrients and good bacteria).
Your immune system must determine whether or not to develop a tolerance to everything you put into your mouth. Whenever you try a new food, it must decide, "Do I like this or do I attack and kill it?"
You are always ingesting bacteria and other substances with your food, no matter how fresh and clean it is, so these must be screened out. While your immune system will "okay" most foods, genetic and other issues may affect its decision. Recent studies also suggest that your immune system's ability to develop correct tolerances depends a great deal on the balance of good bacteria inside your intestinal tract.
When you put something into your tube that the immune system doesn't like, it attacks by means of inflammation and excess mucus production. If your immune system is continually bombarded with messages to attack, its reactions can have major consequences. Inflammation of the digestive tube can in turn lead to damage of the lining of this tube, often resulting in something called "leaky gut" or "gut hyperpermeability." These two terms are simply descriptions of the damage to the digestive tract that is a result of something triggering an immune response.
Article Courtesy: Dr. Stephen Wangen