I am not a coffee drinker, but I met with a friend at a cafe who said he was going to get a cup of insect poison, referring to coffee :)

Caffeine evolved to deter insects. Coffee, tea, chocolate and some other plants all evolved caffeine independently due to similar evolutionary pressure.