Flatulence is made up of five gases: carbon dioxide, hydrogen, oxygen and sometimes methane -- and when it's caused by excess air in the colon, you'll also find nitrogen in the mix. How, exactly, does excess air get into a colon? Well, you swallow it. Swallowing air causes flatulence, and good luck avoiding that while you talk or chew. The best you can do is chew slowly when eating (and especially when chewing gum) and avoid talking while you eat to keep excess air from building up in the stomach; whatever gas doesn't go up (belching) will go down into the colon, destined to become a fart.
Smoking, too, increases flatulence -- although the exact reason flatus is a side effect of smoking isn't known. Some theorize it's irritation in the GI tract that causes smokers to pass more gas than non-smokers, but the more common theory suggests it's all that air smokers swallow while smoking that's doing it.