Most food is not broken down by bacteria, it’s broken down by acids, enzymes, and mechanical action. It’s mostly fiber that’s fermented in the guts, the sort of food that’s not as available to us in the short time food spends in us. Bacteria eat the complex carbohydrates and in turn some of them produce vitamins we need, as well as short-chain fatty acids. In essence they eat our waste and we eat their waste.
A better example would be the role of bacterial fermentation in ruminants like cows and sheep. They have enormous and complex stomachs and intestines designed to extract maximal nutrition from fibrous, difficult-to-digest vegetation. They first grind the plants with their teeth a little bit to break down fibers and some cell walls, then the mush is swallowed into their first stomach. Acids and enzymes in their saliva start the process of breaking down the feed. This food is then regurgitated in wads (cud) to be chewed further, at their leisure. When the cud is finally swallowed it moved to a second stomach called the Rumen, to be fermented by bacteria, protozoa and fungi, and that process takes a couple of days at least! The “bugs” eat the mush and produce sugars, fatty acids, vitamins, and so on. The cow extracts nutrition from that, and the “bugs” enjoy a safe environment with regular infusions of food. Those nutrients are extracted, along with water, in the third and fourth stomachs, and finally what’s left is expelled as waste.
Latest Answers