We usually use "fermenting" with the development of wine. Grapes ferment, creating alcohol. Wine can further ferment into vinegar and spoil the wine. If your thoughts ferment, then they can sour your personality, and cause depression or other illnesses.