A fart is a combination of gases (nitrogen, carbon dioxide, oxygen, methane, and hydrogen sulfide) that travels from a person's stomach to their anus. When a person swallows too much air or eats foods that the human digestive system cannot digest easily gas becomes trapped in his/her stomach. The only way for this excess gas to exit the body is through the anus.
The gas that makes your farts stink is the hydrogen sulfide gas. This gas contains sulfur which causes farts to have a smelly odor. The more sulfur rich your diet, the more your farts will stink. Some foods that cause really smelly farts include: beans, cabbage, cheese, soda, and eggs.