When you eat, you swallow some air. Your body also produces gas naturally in the gut.
The biggest driver is bacterial fermentation. Gut bacteria break down undigested carbs and fiber, producing gases like hydrogen, carbon dioxide, and sometimes methane.
Gas is moved through the intestines and may cause bloating, cramps, or flatulence. If fermentation increases or slows, pressure can rise and symptoms may feel stronger.