i'm sure that there was an original reason for the production of the various chemicals in cannabis, whether as an attractant or a repellent, that helped assure the plant's survival, but its use by humans over the centuries for its psychoactive properties has undoubtedly bred a plant, whether intentionally or accidentally, with far higher concentrations of those substances. i've always just considered it a happy coincidence that those chemicals, when mixed with our own brain's chemistry, induce a pleasant and harmless effect. believing that that effect is the plant's sole purpose for producing those chemicals would tend to imply an importance to humanity that i'm not sure we deserve. just be thankful it doesn't make you vomit.