Δ9-Tetrahydrocannabinol (THC-9) is the major psychotropic constituent of Cannabis sativa L.. Improper storage conditions can lead to oxidation of THC-9 contained in both inflorescences or extracts into cannabinol (CBN), a less psychoactive cannabinoid generally used as marker for determining cannabis aging. 
Many cannabinoids are biosynthesized from cannabigerolic acid (CBGA) which in addition to convert to cannabigerol (CBG), it forms through enzimatic action tetrahydrocannabinolic acid (THCA). If heat exposed, THCA is decarboxyated to THC. Nevertheless, when THCA is exposed to UV-light it converts to cannabinolic acid (CBNA), that after heating finally decarboxilates to CBN. It has been proposed also a decomposition mechanism of THC-9 involving the formation of intermediates containing epoxy or hydroxy groups such as a racemic mixture of 8, 9-dihydroxy-Δ6a (10a)-THC and 9, 10-dihydroxy-Δ6a (10a)-THC, which are susceptible to acid and heat leading to the formation of CBN.  Unless samples are stored in sealed containers and in low temperature freezers at least at -20 °C, there is always a small percentage of conversion to CBN.
Sometimes the conversion of THC to CBN can help reducing the THC content of an extract or formulation in order to meet the state regulatory directives or improve the bioavailability of the product. CBN is capable of binding to endocannabinoid receptors CB1 and CB2: the weak interaction with CB1 is linked to decreased action on the central nervous system thus reduced phychoactive effects compared to THC, while the high binding affinity to CB2 is associated with higher CBN influence on immune system.
The effects of CBN can overlap and counteract with the ones of THC: while CBN decrease heart rate, intestinal motility and has sedative and anticonvulsant effects, it can also reduce the production of nuclear factor kappa-light-chain-enhancer of activated B cells (NF-κB), which are protein complexes playing a key role in the inflammatory response and which are generally upregulated by the psychotropic THC. 
 Milay L. et al. Metabolic profiling of Cannabis secondary metabolites for evaluation of optimal postharvest storage conditions. Front. Plant Sci. (2020) ; 11:1556. doi:10.3389/fpls.2020.583605
[Journal impact factor = 4.298] [ Times cited = 18]
 Turner CE, ElSohly MA. Constituents of Cannabis sativa L.: XVI. A possible decomposition pathway of delta-9-tetrahydrocannabinol to cannabinol. Journal of Heterocyclic Chemistry (1979); 16(8):1667–1668. [Journal impact factor = 2.139] [ Times cited = 68]
 Hazekamp, Arno et al. Comprehensive Natural Products II || Chemistry of Cannabis. , ((2010); 1033–1084. doi:10.1016/b978-008045382-8.00091-5