One cause of gas and gas pains in the body comes from bacteria that ferment undigested carbohydrates in the colon, according to Mayo Clinic. Normally, carbohydrate-rich foods digest in the small intestine. However, when high-fiber foods reach the large intestine, gas may result.
The process of gas formation in the intestines begins with small amounts of bacteria, says the Canadian Society of Intestinal Research. Because more bacteria live in the large intestine, more fermentation occurs there. This process releases small bubbles of gas into the intestinal tract, similar to the fermentation process used to make champagne. Over time, this gas builds up to uncomfortable levels to produce bloating or even pain.
Fatty foods also can lead to bloating, belching and gas in the stomach because the organ may not empty fast enough, notes Mayo Clinic. Drinking carbonated beverages can lead to a bloated feeling because of the gas bubbles in the drink. Eating too quickly may cause air in the stomach as well.
High-fiber foods, such as fruits, vegetables, legumes and whole grains, commonly produce digestive gas in the intestines, according to Mayo Clinic. Fiber supplements also can exacerbate gas in the gastrointestinal tract. Food intolerances, such as the body's inability to break down lactose or gluten, may lead to gaseous bloating in the large intestine.