Chili peppers are spicy as a strategy to ensure that birds (which can't taste capsaicin) will spread their seeds far and wide and mammals will avoid eating them.