Replying to @vgr and @aplusplus
Often they have defenses against being eaten by the _wrong_ animal (or at the wrong time). Like with chillies, mammals eating them destroys the seeds - that's why chillies evolved to be so spicy. But birds are unaffected by the capsaicin, and disperse the seeds just fine.