They can be silent but deadly, or loud and proud, but the stinky truth is everybody farts — yes, including you. The average person passes gas 10 to 20 times a day and produces anywhere from 500 to 1,500 milliliters, but why exactly do we fart? In the TED Ed video lesson “Why do we pass gas?,” Pruna Kashyap clears the air on how gas is made by taking us on a journey into the intestines and telling us which foods contribute most to flatulence, and most importantly, why it stinks.

Flatulence can be a surprising and often embarrassing experience, but it’s actually a good indicator of healthy gut bacteria. Our intestine is home to trillions of bacteria that we have a symbiotic relationship with. “We provide them with a safe place to stay and food to eat. In exchange, they help us extract energy from our food, make vitamins for us, like vitamin B and K, boost our immune system, and play an important role in gastrointestinal barrier function, motility, and the development of various organ systems,” says Kashyap in the video.

Gut bacteria get their nutrition primarily from undigested food, including carbohydrates and proteins that enter the large intestine. They ferment this undigested food that produces a wide range of compounds, such as short-chain fatty acids, and of course, gases. The most common gaseous products of this bacterial fermentation are carbon dioxide, hydrogen, and sometimes methane, which are odorless. But why do they sometimes stink?

The foul smell that accompanies farts is usually due to volatile sulfur compounds, such as hydrogen sulfide and methanethiol, or methyl mercaptan. They constitute less than one percent volume and are the result of a high concentration of indigestible carbs like beans, lentils, dairy products, onions, leeks, radishes, potatoes, oats, wheat, cauliflower, broccoli, cabbage, and Brussels sprouts. Since we lack the enzymes, the fermentation of complex carbs takes over, leading to more gas than usual. People who are lactose intolerant will often suffer similar complications.

Remember, passing gas is a completely normal physiological process. The amount and type of gas we pass can vary based on our diet and bacteria in our intestine. No farts are created equal.

Next time you let one rip, you’re doing good for your health.