The intestine’s job (digestion) is to break the presented raw material (food) into small, absorbable form (essential nutrients), which then pass through the intestinal wall (absorption) into the blood stream for transportation (distribution) to the various locations where they are used for either work (metabolism) or construction/repair (anabolism) of the body. Nutrients not needed immediately are stored as fat or glycogen for future use.
As digestive enzymes break the chemical bonds, gas results in the lower bowel for release, about 14 times daily on average. Of the three nutrients (carbohydrates, fats, and proteins), carbohydrates are the most effective gas producers. If we digest carbohydrates, little gas is formed. About 50% people don't completely break down carbohydrates and intestinal bacteria act on them to produce gas.
Some ways to reduce gas formation is to: eat slowly and thoroughly chew the food, sip rather than gulp liquids, minimize fizzy beverages, avoid chewing gum, and eliminate sugar-free foods containing sorbitol or xylitol (which are both poorly digested). You must exercise, and if you consume legumes, soak them well prior to cooking and discard the water. Use of ginger etc. too helps.