Relatively speaking, chimpanzees have much bigger large intestine (colon) than humans do. The larger colon is better for the chimps' low-quality, high-fiber diet because it allows the fibrous fruits, stems, and leaves to be digested (i.e., fermented by gut bacteria) for a longer period of time.
Just for reference, a typical chimp diet might look like: 60% fruit, 35% plants and seeds, 5% meat. The fiber content of a chimp diet is roughly 45%, while the fiber content of a "typical" hunter-gatherer diet is roughly 20%. As a result, humans have a larger small intestine, which is where a lot of nutrients are absorbed from high-quality, low-fiber foods.
This is a good link to learn more: What is the "Optimal" Diet for Humans? (Part 2). The graph below is from the cited link, and it's a bit hard to read but you can see that humans have a high small-intestine to large-intestine ratio, while chimps have a very low ratio. Gorillas have the lowest ratio among all apes measured in the graph, and this is expected because gorillas eat the lowest-quality diets, with 2/3 of their diet being stems and leaves, and the remaining 1/3 being fruit.