TBF, life's objective is to reproduce and keep its genetic materials continuing on. Even if humans propagate and consume said plant because they find it desirable, that is still a success for the plant. So even if it has toxic caffeine or fiery capsaicin to deter some pests and humans find it enjoyable, the plant wins.