In a post about the manifold functions of trichomes in plant life, Anna Tiley at Science Says reveals this nugget of information:
Some of the best known examples of trichomes are found on cannabis plants. The function of these was recently explained in a talk at the Society of Biology by GW Pharmaceuticals’ Director of Botanical Research and Cultivation, Dr David Potter. Dr Potter explained that these gland-like trichomes produce a complex mixture of sticky smelly chemicals known as cannabinoids. The plant releases these compounds to trap insect predators, preventing them from eating the leaf or spreading disease to the plant. One of the cannabinoids made by the plant, called tetrahydrocannabinol (THC), is also extracted and used to give recreational drug users a “high”.