Flatulence occurs when a food does not break down completely in the stomach and small intestine. As a result, the food makes it into the large intestine in an undigested state. For example, if you are "lactose intolerant," it means that you lack an enzyme (lactase) in your intestine -- the enzyme that breaks lactose apart into two sugar molecules so they can enter the bloodstream. Without lactase, lactose passes undigested through the stomach and small intestine and arrives in the large intestine.

Certain foods produce more flatulence than others because they contain more indigestible carbohydrates than others. Beans, as you might expect, are particularly well-endowed in this regard.