Whether a drug is prescribed by the doctor, bought over the counter or obtained illegally, we mostly take their mechanism of action for granted and trust they will do what they’re supposed to.

But how does the ibuprofen pill turn off your headache? And what does the antidepressant do to help balance your brain chemistry?

For something that seems so incredible, drug mechanics are wonderfully simple. It’s mostly about receptors and the molecules that activate them.

Receptors

Receptors are large protein molecules embedded in the cell wall, or membrane. They receive (hence “receptors”) chemical information from other molecules – such as drugs, hormones or neurotransmitters – outside the cell.

These outside molecules bind to receptors on the cell, activating the receptor and generating a biochemical or electric signal inside the cell. This signal then makes the cell do certain things such as making us feel pain.

Agonist drugs

Those molecules that bind to specific receptors and cause a process in the cell to become more active are called agonists. An agonist is something that causes a specific physiological response in the cell. They can be natural or artificial.

For instance, endorphins are natural agonists of opioid receptors. But morphine – or heroin that turns into morphine in the body – is an artificial agonist of the main opioid receptor.

An artificial agonist is so structurally similar to a receptor’s natural agonist that it can have the same effect on the receptor. Many drugs are made to mimic natural agonists so they can bind to their receptors and elicit the same – or much stronger – reaction.

Simply put, an agonist is like the key that fits in the lock (the receptor) and turns it to open the door (or send a biochemical or electrical signal to exert an effect). The natural agonist is the master key but it is possible to design other keys (agonist drugs) that do the same job.

Morphine, for instance, wasn’t designed by the body but can be found naturally in opium poppies. By luck it mimics the shape of the natural opioid agonists, the endorphins, that are natural pain relievers responsible for the “endorphin high”.

Specific effects such as pain relief or euphoria happen because opioid receptors are only present in some parts of the brain and body that affect those functions.

The main active ingredient in cannabis, THC, is an agonist of the cannabinoid receptor, and hallucinogenic drug LSD is a synthetic molecule mimicking the agonist actions of the neurotransmitter serotonin at one of its many receptors – the 5HT2A receptor.

Antagonist drugs

An antagonist is a drug designed to directly oppose the actions of an agonist.

Again, using the lock and key analogy, an antagonist is like a key that fits nicely into the lock but doesn’t have the right shape to turn the lock. When this key (antagonist) is inserted in the lock, the proper key (agonist) can’t go into the same lock.

So the actions of the agonist are blocked by the presence of the antagonist in the receptor molecule.

Again, let’s think of morphine as an agonist for the opioid receptor. If someone is experiencing a potentially lethal morphine overdose, the opioid receptor antagonist naloxone can reverse the effects.

This is because naloxone (marketed as Narcan) quickly occupies all the opioid receptors in the body and prevents morphine from binding to and activating them.

Morphine bounces in and out of the receptor in seconds. When it’s not bound to the receptor, the antagonist can get in and block it. Because the receptor can’t be activated once an antagonist is occupying the receptor, there is no reaction.

The effects of Narcan can be dramatic. Even if the overdose victim is unconscious or near death, they can become fully conscious and alert within seconds of injection.

Membrane transport inhibitors

Membrane transporters are large proteins embedded in a cell’s membrane that shuttle smaller molecules – such as neurotransmitters – from outside of the cell that releases them, back to the inside. Some drugs act to inhibit their action.

Selective serotonin reuptake inhibitors (SSRIs) – such as the antidepressant fluoxetine (Prozac) – work like this.

Serotonin is a brain neurotransmitter that regulates mood, sleep and other functions such as body temperature. It’s released from nerve terminals, binding to serotonin receptors on nearby cells in the brain.

For the process to work smoothly, the brain must quickly turn off the signals coming from the serotonin soon after the chemicals are released from the terminals. Otherwise moment-to-moment control of brain and body function would be impossible.

The brain does so with the help of serotonin transporters in the nerve terminal membrane. Like a vacuum cleaner, the transporters scoop serotonin molecules that haven’t bound to receptors and transport them back to the inside of the terminal for later use.

SSRI drugs work by getting stuck inside the vacuum hose so unbound serotonin molecules can’t be transported back into the terminal.

Because more serotonin molecules are then hanging around receptors for longer, they continue to stimulate them.

We can crudely say the extra serotonin moderately turns up the volume of the signal to enhance positive mood. But the actual way this has an effect on depression and anxiety is far more complicated.

Around 40% of all medicinal drugs target just one superfamily of receptors – the G-protein coupled receptors. There are variations on these drug mechanisms, including partial agonists and ones that act like antagonists but slightly differently. Overall though, a lot of drugs actions fall into the categories described above.