The following is just a summary of the link in my signature:

Basically, you have a chemical called Dopamine, which is the 'reward' chemical in your brain and one of the 'happy' chemicals (along with serotonin and norepinephrine)

Now, most drugs (heroin, amphetamines, alcohol, meth, cocaine) work by affecting the dopamine directly. This contrasts from cannabis, in that cannabis does NOT directly act upon your dopamine.

Instead, there is another cell, called the GABA cell. The GABA cell is responsible for inhibiting (stopping) the release of dopamine. THC stops the GABA from stopping your dopamine, so your dopamine levels go up.

That's how it works. Contrary to what all the 'experts' say it doesn't work on your dopamine directly nor does it really affect serotonin.