THC exists within the marijuana plant in a form that has a CO2 attached to it.This is considered to be an inactive form.When that molecule is heated, the CO2 easily pops off and floats away. This is then the "active" form of THC.How much heat is required to break off this CO2. The warmer it is the faster it floats off.
At room temperature the CO2 will all be gone in about a year.
At 200F it should all be gone in about a half hour.
At 300F it should be gone in about 2 seconds.
In a burning ember (say 2000F) instantly.
At body temperature (as in after you eat it) I believe it takes several hours.
Marijuana produces THCA, an acid with the carboxylic group (COOH) attached. In its acid form, THC is not very active. It is only when the carboxyl group is removed that THC becomes psychoactive. When marijuana is smoked, the THC behind the hot spot is vaporized as the hot air from the burn is drawn through the joint or pipe bowl to the unburned material. The liquid THC and other cannabinoids have a boiling point of between 180-200 C (355-392 F). Before they turn gaseous, at around 106 deg C (220 F), the carboxyl group is released from the molecule as carbon dioxide and water vapor. ... However, it is easy to make sure all the THC is decarboxylated and is at full strength before it is extracted. Although decarboxylation takes place rapidly at 106 deg. C, it proceeds at a more gradual pace by placing the cannabis in a room with low relative humidity and room temperature. As the temperature rises, the rate of decarboxylation increases.
CBD also exists within the plant in the form of CBDA. It also, when heated, tosses off a CO2 to become CBD.
This is a very handy reaction in that one of the products of the reaction is a gas (CO2). That means the reaction can go to completion. That is every bit of the compound tosses off the CO2.
Many of the other cannabinoids within the cannabis plant exist in the inactive, acid form.
Now then a note of caution about the application of heat. Some of the most beneficial compounds within the plant are those that make up the smell and colors of the plant. Many of these drift off when you warm the material.
There is a balance between enough heat to activate it and the loss of potential medically valuable compounds.
In short Removal of the Plant Matter (Carbon) that can have problems such as mold, bacteria, viruses, etc. will keep the CBD and THC in it's purest most sterile form making it of Medical Grade of Quality.