Your digestive tract has an important relationship with your immune system, since the digestive tract is one of the mechanisms through which you're exposed to tremendous numbers of pathogenic organisms each day. The immune system works with the digestive tract to help protect you from infection by these potential invaders.
Your digestive tract extends from your mouth to your anus, and includes the stomach, small intestine, and large intestine. It's the system responsible for breaking down large molecules in your food into smaller molecules that you can absorb, and it's essentially an exterior surface of the body, since it's regularly exposed to outside substances. Because of this, it's exposed to bacteria and viruses on a regular basis, and its absorbent lining and moist, dark atmosphere would be ideal for pathogenic colonization if it weren't for the immune system.
Your immune system consists of a complex network of organs, as well as cells and proteins. Antibodies, for instance -- though they're probably the best-known aspect of the immune system as far as the general public is concerned -- are just one small component of the system. Your immune system also depends upon cells to kill invading organisms, and chemicals that don't require the involvement of cells at all, but which are simply toxic to bacteria and viruses.
You have two types of immune responses, explains Dr. Lauralee Sherwood in her book "Human Physiology": innate and acquired. Innate immune responses are non-specific, and don't require exposure to a pathogen to trigger them. Your digestive system depends upon many innate immune responses, such as the lysozyme you secrete in saliva, which breaks down bacterial cells. Acid in the stomach does the same thing. In this way, the digestive tract actually helps the immune system to protect the rest of the body by preventing exposure to pathogens.
Acquired immunity requires that you've been exposed to a pathogen; once you've been exposed, your cells recognize that pathogen as an invader and can fight it off. Antibodies are a major component of acquired immune responses; you build antibodies to the pathogens to which you've been exposed, explains Dr. Gary Thibodeau in his book "Anatomy and Physiology." Some of these -- called IgA -- you express on the mucous surface of the gut. These help kill pathogens before they can colonize the intestine.