People fart because of gases that mix during the digestion process and need to be expelled from the body. This is done through the rectum and the accompanying noise is usually because of closed buttocks and the anal sphincter vibrating. You can find more information at en.wikipedia.org/wiki/Flatulence.
Some foods you eat, the good bacteria in your digestive tract like. When they break it down, they produce methane as a byproduct. That gas has to go somewhere and the path of least resistance is out the back door. Don't stand near an open flame.