There have been studies of African acacia trees ,that show their ability to spontaneously raise their level of tannins, when other trees in the grove are attacked by giraffes.
Back when I grew MJ, we used to cut leaves from the plants to simulate insect attacks, in order to stimulate the plant...