Bugs make food taste better, at least in the long run.
From the crisp snap of wasabi to the soothing bitterness of coffee, many of our favorite flavors have been created in response to some kind of predatory insect. Bitterness is generally a sign of toxicity, which in foods like broccoli or coffee beans, evolved to deter bug that would otherwise destroy a plant’s chances of reproduction, usually by eating fruit without dispersing its seeds. Pepper plants take this mouth-watering defense up a notch, trading bitterness for spicy capsaicinoids, like the capsaicin found in a jalapeno pepper. It’s less subtle than broccoli’s bitterness, but it also has to pull double duty, repelling both insects and fungi that would harm the pepper.
More parasites means mas picante
There are many of pathogens that can harm a plant, but a pepper’s capsaicinoids probably evolved to help fight fungi that target their seeds. Ideally, a pepper, as the seed-carrying fruit of the plant, would be carried by an animal to a new location where those seeds could be dispersed. Fungi then pose a specific threat because they consume the seeds themselves, wasting all the resources the plant put into growing the seeds and fruit. Capsaicinoids help fight the fungi as well as the insects that help the fungi gain access to seeds in the first place.
Researchers studying capsaicinoid production in various peppers found that the plant’s location played a big role in how spicy they’d turn out to be. Cooler areas produced milder peppers, while hotter locales produced spicier fruit. Focusing in on the Capsicum chacoense pepper from Bolivia, researchers found that hotter peppers were first attacked by insects, and that the scars left in the fruit by those bugs provided entry points for fungal parasites. So the plants that were at more risk of fungal infection then produced more capsaicin to act as a bigger dose of fungal protection. This is likely why the seeds of many chiles pack a much bigger punch than the flesh of the fruit itself- that delicious burn is concentrated where it’s needed most.
Bland for the birds
So if fiery peppers evolved to be avoided by insects and fungi, what creature provided the proper seed dispersal for these plants in the first place? While humans have come to enjoy the burn of a good chile pepper, most mammals aren’t so keen on a spicy dinner. Birds, on the other hand, don’t have capsaicinoid receptors in their mouths, leaving them to enjoy the vitamins, sugar and fiber found in a pepper without any sense of the burning we get to experience. The birds are probably happy with this arrangement, but it’s hard not to feel that they’re missing out on the pleasurable pain a good pepper can really add to your meal.
Source: There's a fungus among us and it's making peppers spicy by Jennifer Tsang, The Microbial Menagerie