Most of the alkaloids in plants, from cannabis to tobacco to shrooms to coca and Mimosa, are there to prevent insects eating them, try and blow some very potent tobacco on a fireant and watch it convulse, they hate the stuff.