The foods we eat directly impact how frequent -- and how odorous -- our flatus will be.
Dairy products, for example, cause flatulence in people who don't produce enough lactase, an enzyme needed to digest milk sugars. Fructose (including high-fructose corn syrup), table sugar and artificial sweeteners such as sorbitol also all pass undigested through the digestive tract and can cause excessive gassiness upon reaching the colon.
If the body's digestive system can't easily absorb a food, the undigested food has time to ferment in the colon, and when that happens you've got gas -- smelly gas. While the foods that affect you may differ than those that affect others, at the heart of the fart you'll find carbohydrates -- that's fiber, starches and sugars -- are usually the major culprit.