Fermentation. The bacteria in your colon digest the fibers and other food types in your diet. They convert these foods into gas. (particulary foul smelling hydrogen sulphide ) try switching up your diet with different type of fiber sources and proteins lower in methionine and cysteine .May consider possible probiotics. If you are on medications then this may also be contributing your your excess gas.
Swallowed air/ diet. The digestive system is an elaborate tube from the mouth to the anus. All people swallow air when they eat & some take in more than others. You either belch it up or create flatus. If you eat foods that your body doesn't digest completely, the germs in your gut will & they create flatus in the process. Keep a food diary & keep track of what makes you gassy & avoid them.