It ferments, like every other food mixture, because there's microorganisms (bacteria and yeast) in the air and the ingredients that reproduce and consume the sugars and starches in it. Any jarred vegetable, fruit, or herb will ferment unless there is something specifically to prevent microorganism growth. You can't get rid of these just by washing the outsides of everything, since these organisms are present inside the peppers, in the air, and particularly in the garlic, which is practically a microorganism incubator.
For some sauces, the fermentation is desired and intended, but apparently for yours it isn't. So let's look at the ways you can stop fermentation:
1) Canning: if you seal, and heat the jarred pepper sauce to a sufficient heat for enough time, that will prevent fermentation more-or-less indefinitely until it is opened. Depending on the heat-treatment and canning process, it may be storable at room temperature, or it may need to be refrigerated. Note that, since you're cooking the sauce, this may change its taste and texture.
2) Salting: if there's enough salt in your pepper sauce, it does not ferment because nothing can live in it; that's the secret to shelf-storable pepper pastes you can buy at the store.
3) Acid: on the opposite end, if the pepper sauce is sufficiently acidic, this will also stop fermentation; this is how shelf-stable pepper sauces like Tabasco work. You'll also need to strain out the solids, though. You need to be careful to add acids, like vinegar and citric acid, that don't come with too much additional sugar (like lemon juice does).
4) Artificial preservatives, like sodium benzoate, are strong anti-microbial substances that can prevent fermentation.
5) Combination: because peppers and garlic are difficult from a preservation perspective (peppers are low-acid and high-sugar, and I've already mentioned garlic), it can help to do a combination of methods. When I make jarred salsa, I add vinegar and can it, and preserved lemons use both acid and salt.
Anyway, the Ball site has lots more advice about canning and preserving, you can find pretty much everything you want to know there, and you can also look at the answers to this question.