Let's start with the most obvious cause of stinky farts: It's related to something you ate.
Gases produced during digestion can be a healthy byproduct of a well-balanced diet rich in fiber. Digestion occasionally produces hydrogen sulfide, which can give any air biscuit a rotten-egg odor.