You are not the first person to think about this. It is well-known that psilocybe mushrooms use psilcybin and psilocin as a self-defense mechanism. I see no reason why THC would be there for any other reason. Really, what is the point of THC other than to scare off predators? Makes sense to me.