You use your mouth to eat, right? You probably know about this, but the food goes down your Esophagus, then to the Stomach, gets involved with teh liver, pancreas, and gallbladder, then goes to the intestines. First, it goes to the small intestines, made up of the duodenum, the jejunum, and the heum. In adults, the small intestine is 7 meters long! The small intestine's job is to extract nutrients, while the large intestine's job is to extract water. The stomach breaks down the food.
The intestinal systems are very "fragile". The immune system cannot unleash much power here, or else diarrhea is the result. As a result, in the guts, (small and large intestine for now), there are lots of bacteria. However, those bacteria are not "bad" as you view it; the body needs them to digest and break down certain things.