So why are psychoactive compounds, A.K.A. drugs, so appealing? The answer lies in how they work. Once inside our bodies, psychoactives slip mischievously inside our brains and start fiddling around with the control panel. Different psychoactives fiddle in different ways, but something the popular ones all have in common is that they tend to crank up the happiness dial.

Many of these popular drugs, from caffeine to cocaine, were invented by plants. But why did they do this? Plants don’t have happiness knobs to be twiddled by drugs, and they’re definitely not just out to give us humans kicks. And how do insects come into the picture?

To properly understand this tale, we’ll have to travel 450 million years back in time, trace the progression of a brutal conflict that has claimed more lives than the entire history of human warfare, and finish by shrinking down to gaze at the very foundations of consciousness itself.

Hold on tight, it’s going to be a bumpy ride.

In the Beginning…

The majestic Planet Earth, 450 million years ago in the late Ordovician period:

Well, something like this. Maybe.

The first multicellular organisms to blob up onto land were sluggish low-lying plants that looked pretty much like modern day mosses and liverworts. And for a while, that’s all there was.

For those stunted critters, this brave new rocky world above the roiling sea must have seemed an idyllic paradise. Vast stretches of land awaited colonisation, the air was heady with CO2, and there wasn’t a predator to speak of. Alas, it wasn’t to last.

When we hear the word “herbivore”, we usually think of sizable mammals like cows and rabbits and giraffes. But plants have a far more ancient, insidious, and destructive foe. More than 200 million years before evolution wobbled out its first half-arsed proto-rat, there were insects.

By raw numbers, insects are the most successful branch of life of all time, boasting an estimated 6-10 million species. Four “super-radiations” have been particularly virile: beetles, moths, wasps and flies. These types of insect alone make up the majority of animal life on Earth.

Back in the Ordovician though, it was a different story. Much like early plants, the first insects were actually kind of crappy.

They were probably scavengers or predators, feeding on decaying organic matter and each other. They also weren’t particularly mobile. It would take evolution 70 million years to puzzle out how to build wings, so these early pioneers were stuck with crawling and walking to get around.

It wasn’t long though before something clicked, and the early insects turned their prehistoric compound eyes to the untapped treasure lying at their (numerous) feet: a delicious, stationary and completely undefended food source.

The Never-Ending War

Those first few centuries must have been a gustatory massacre: hordes of rampaging insects feasting on the soft succulent vegetation.

But plants fought back. They diversified, developing intricate vein-like vascular tissue that allowed them to grow larger and migrate inland. Insects followed, and responded by evolving Sap Suckers, fiendish vampires who could stab into the plants and drink their very fluids. This one keeps its enormous proboscis tucked back under its body:

Plants began secreting waxy coatings to make their leaves slippery and harder to penetrate. Marauding proto-aphids toppled hundreds of times their body height to the ground.

Insect forms multiplied, and one lineage decided to get into the mining business, adapting their bodies to best burrow into leaves, submerging themselves in a giddy world of pure deliciousness. Plants retaliated, developing machinery to sacrifice infected leaves and toss them scornfully to the ground, curled and brown.

The battle was well and truly under way.

Plants reinforced their critical systems – stems and seeds – with tough fibres that gradually evolved into woody bark and shells. Insects found ways to keep pace by strengthening their mandibles. Worse yet for plants, a strain of Leaf Miners mutated themselves into a grotesque new foe: Plant Borers. These creatures were able to burrow not just into leaves but directly into stems, roots and even the precious seeds.

Life force battled hard against life force. Ecosystems diversified and increased in complexity as military innovation piled up upon military innovation. Bizarre alien forests rolled across the Earth as the Ordovician Period faded into the Silurian, which in turn faded into the Devonian. And all the while, inexorably, the death toll crept higher.

About 406 million years ago, insects finally mastered flight. Having wings transformed their world from essentially flatland into a rich 3-dimensional environment of endless possibilities. Migration and innovation boomed, and with it insects differentiated into a dizzying array of never-before seen forms.

During the next 60 million years most modern orders of species came into existence. Early winged arthropods included crickets and the elegant predatory dragonflies. And soon enough, there were beetles.

Shortly afterwards, beetles were joined by wasps, moths and flies, and the four super-radiations were loosed upon the world – a beautiful insect evolutionary tree can be found here. It seemed that insect domination over plants was assured.

In a final twist of the plot, in this harsh prehistoric world when all seemed lost, plants stumbled upon a way to turn the tide of the war. They would transform insects’ greatest strength – mobility – into their greatest weakness. Plants invented chemical warfare.

Insects aren’t just gifted with movement; they are dependent upon it to do anything – to find food, to escape predators or to reproduce. Movement requires the coordinated use of multiple systems: powerful flight muscles, machinery for vision, advanced aerial navigation equipment. And all of these systems are plugged directly into a brain.

Behold: Flybrain

Plants began producing toxic compounds called allelochemicals to attack insect brains. Any insect eating a plant would have to eat its allelochemicals too. These toxins would then seep into its brain and start messing with the delicate movement systems. Insects would either have a seizure and die from energy depletion, or become paralysed and be eaten by predators.

What do these deadly allelochemicals looks like? Examples include nicotine, caffeine and cocaine.

As always in evolutionary wars, insects responded, this time by developing resistances. But the cost was great. Many species were forced to become specialists, living on only a narrow range of plants whose poisons they could tolerate. Some probably failed to adapt altogether.

Insects and plants dug into the trenches, so to speak, and gradually, over a long period, the conflict settled into a kind of equilibrium. The two ancient enemies constantly refined their poisons and resistances, their weapons and armour, but neither ever again gained a real upper hand over the other. Eventually some plants and insects even set aside their differences and, with their powers combined, forged one of nature’s all-time greatest collaborations: flowering plants and pollinators.

And what about us mammals? Millions of years passed in this period of plant-insect equilibrium; amphibians arose; reptiles arose; and finally, some time in the early Triassic, the very first mammals peeled away from reptiles to launch our own evolutionary journey of diversification and warfare. We sure were latecomers to the party though. By this point, insects and plants had been at each other for 200 million years.

Now, to finally answer the mystery about drugs, it’s time to go…

Inside the Mind Itself

To understand how brains work, it’s surprisingly useful to look at how computers are built. Computers are essentially big networks of logic gates connected by wires. If you’re not familiar with them, logic gates take in two signals and use them to output one signal. The signals can be either ‘on‘ or ‘off‘, and different types of logic gate behave differently.

An OR logic gate outputs on when either input is on.
Think: “I’ll go out with my friends if either mum or dad says I’m allowed to.”

An AND logic gate outputs on when both its inputs are on.Think: “I’ll only clean my room if both mum and dad make me.”

With enough logic gates strung together, computers are able to carry out the endless complex operations that we tell them to.

Brains work is a remarkably similar way, using neurons instead of wires. There are two major differences though:

Neurons aren’t limited to just two inputs, and instead can receive signals from up to hundreds of other neurons

Neurons communicate on and off signals using neurotransmitters, tiny molecules that substitute for electricity

So really, a brain is just a (mind-bogglingly complex) tangle of neurons that form an astronomical number of logic gates. These logic gates are endlessly being bombarded with neurotransmitters carrying on and off signals. Logic gates rapidly read these inputs, process them into their own on or off signal, and fire it onwards, from neuron to neuron, logic gate to logic gate, racing and rippling and splitting and looping around, all in a vast never-ending neurotransmitter Yin-Yang sea of Dos and Don’ts, of ons and offs.

And through this process, we control every minuscule aspect of our existences: breathing, feeling, moving and consciousness itself.

Plant allelochemicals, A.K.A. psychoactive drugs, work by mimicking insect neurotransmitters. They screw up the fine Yin-Yang balance of signalling, either by sending an unregulated blast of ON, or freezing the system with a wave of OFF. Enough allelochemical and the insect dies from either seizure or paralysis.

Humans are very distant cousins of insects, around 500 million years distant, and we use many of the same neurotransmitters. However, with so much time apart, our brains have obviously evolved down separate paths, and our logic gates are made somewhat differently. Because of our shared ancestry with insects, plant drugs designed to attack insects can still affect us, but only in a weak and wobbly kind of way. If allelochemicals are like a bolt of lightning to insects, we get a warm shower of sparks.