Plants make substances called alkaloids to protect themselves, and humans have long taken advantage of these chemicals, using them in painkillers, treatments for disease and household products such as caffeine and nicotine.