One day in London in 1855, during an unusually cold winter, Charles Darwin went for a walk. As he strolled along the banks of the ice-bound Thames, he noticed some pigeons foraging for food. He began to wonder about their relationship to so-called ‘fancy pigeons’, the more exotic varieties favoured by fanciers and breeders. Was there an ancestor common to the nondescript blue-grey creatures on the riverbank, and those featured on the front page of Darwin’s newspaper that day, all puffed-up chests and improbable neck-ruffs?

Darwin was a pigeon-fancier himself and raised birds at his home in Kent. Observing these creatures closely, he became convinced that the various pigeon breeds descended from a single ancestor: the rock dove, or Columba livia. His fancy pigeons all interbred freely, and it seemed unlikely that a different species corresponded to each particular characteristic, none of which lived on in the wild. If man could breed a multiplicity of forms from a single thing, Darwin thought, perhaps nature could too. Domestication, for Darwin, was a laboratory for the study of evolution.

But what, exactly, is domestication? Darwin noticed that, when it came to mammals, virtually all domesticated species shared a bundle of characteristics that their wild ancestors lacked. These included traits you might expect, such as tameness and increased sociability, but also a number of more surprising ones, such as smaller teeth, floppy ears, variable colour, shortened faces and limbs, curly tails, smaller brains, and extended juvenile behaviour. Darwin thought these features might have something to do with the hybridisation of different breeds or the better diet and gentler ‘conditions of living’ for tame animals – but he couldn’t explain how these processes would produce such a broad spectrum of attributes across so many different species.

We’re still puzzling over the hows and whys of domestication. Advances in animal genetics, both ancient and modern, coupled with new techniques in archaeology, have illuminated at least some of the mechanisms behind this previously hidden transition. It’s deeply bound up with the origins of the so-called ‘Neolithic revolution’, when humans first turned to farming around 12,000 years ago. But the history of the human relationship to animals and agriculture is now being rewritten. Domestication, it appears, wasn’t a one-way street: new research suggests that species moved from wild to tame multiple times over their history, and that human agency played a far smaller role than previously believed. It’s also becoming clearer that, in the millennia we’ve spent changing animal genetics, they’ve been changing us in turn.

Melinda Zeder, an archaeologist at the Smithsonian Institution in Washington, DC, has identified three main routes to domestication. The ‘directed’ pathway is the most straightforward. It happens when humans deliberately set out to amplify some desired trait in a species, for example, breeding donkeys to be good for transport, or minks to have luxuriant fur – or, for that matter, fancy pigeons to look fancy. (Darwin marvelled at the ‘astonishing’ diversity of fancy pigeons in On the Origin of Species, from the hooded Jacobin to the immensely heavy Runt, the short-faced Tumbler to the magnificently berumped Fantail. ‘I have kept every breed which I could purchase or obtain, and have been most kindly favoured with skins from several quarters of the world,’ he wrote in 1859, adding that ‘not one man in a thousand has accuracy of eye and judgment sufficient to become an eminent breeder.’)

The ‘prey’ pathway, meanwhile, happens when humans take animals they previously hunted in the wild, and begin managing them in herds, either by creating environments that suit them, or capturing and confining them. Goats, sheep and cattle all fit into this paradigm, as do, somewhat more unexpectedly, horses, which were raised for meat well before anyone figured out you could ride them as well.

Aurochs, the wild progenitors of today’s cattle, were particularly difficult to domesticate. Picture a cow the size and weight of a Volkswagen bus, with a set of wickedly curved horns extending three feet either side of its skull. Farmers started trying to shepherd these immense creatures some 10,500 years ago, probably somewhere near the border of Turkey and Syria. Most modern-day cattle breeds descend from just 81 founding female auroch lineages. And, unlike their contemporaries the mammoth and woolly rhino, aurochs almost made it into the present. ‘Their strength and speed are extraordinary,’ Caesar wrote after he saw aurochs during his conquest of Gaul, in the first century BC. ‘They spare neither man nor wild beast which they have espied.’ But aurochs gradually vanished from most of northern Europe, making a last stand in a few pockets of forest in Poland, where hunting them was the exclusive privilege of the king. The last auroch died in 1627.

Finally there is the ‘commensal’ pathway, in which animals are drawn to humans by attractive food sources – especially trash, but also crops, mice and other pests. Through long interaction, they essentially domesticate themselves. Cats seem to have come into our lives this way, lured by the grain-eating rodents that accompanied the earliest farmers in the Middle East some 12,000 years ago. The descendants of these Middle Eastern cats then spread to Egypt and across the Mediterranean, before expanding their range to northern Europe and the rest of the world by jumping on ships. One cat with Egyptian roots made it to Germany, apparently by stowing away on a Viking vessel – unless, that is, it was invited on board to hunt rats.

Domestication was a gradual affair, full of pitfalls and false starts, during which the border between wild and tame remained fluid

Dogs also evolved along a commensal route from wolves, thousands of years before other species, somewhere between 14,000 and 32,000 years ago. Because they were domesticated so long ago, and have crossbred with wolves many times in the intervening millennia, pinning down precisely when and where dogs first emerged is one of the most daunting quests in the study of domestication. Researchers have tried searching for early dog burial sites, working backwards from living breeds, and studying the DNA of so-called ‘pariah dogs’, the feral dogs who live on trash in villages across Europe and Asia. So far, the answers have been mixed. The research into the village dogs indicates that the species has its origin in Central Asia, somewhere between India and Nepal, while other studies point variously to East Asia, Central Asia, the Middle East or Europe. DNA extracted from the bodies of dogs at an ancient Irish burial mound suggest that there were two separate instances of domestication, one in Asia and one in Europe, according to a study published in 2016.

Other animals might have followed a few different paths to human cohabitation. Studies of pig genomes, both ancient and modern, have revealed that boars were domesticated on at least two separate occasions, in China and in the Middle East, around 8,500 BC. The first farmers in Europe arrived from Anatolia with Middle Eastern swine in tow, which then interbred with local boars over thousands of years, to the point that today’s pigs look as if they’re of native origin. A similar thing happened with chickens: they gained their yellow legs relatively recently, within the past 2,000 years, by interbreeding with wild junglefowl native to South Asia. Tame llamas mixed with wild guanacos and vicuñas (types of South American camelid) so many times that their family tree is impossible to pull apart.

The overall picture is that domestication was a gradual affair, full of pitfalls and false starts. It took thousands of years of tinkering before agriculture as we know it came into being, and for much of that time, the border between wild and tame remained fluid. At the outset, this probably didn’t matter much. Early sea-faring pioneers who travelled from the Middle East to Cyprus brought wheat, barley and pigs, according to archaeological investigations of village sites dating back 10,000 years. But they also took with them species that weren’t domesticated, such as fallow deer and foxes. They didn’t distinguish between wild and tame. Instead of transporting just a few valuable species, they took with them a whole ecological niche. As Zeder writes: ‘They simply took with them the world that they knew.’

In 1959, the Russian biologist Dmitry Belyaev moved to Siberia to see if he could simulate the evolution of dogs. He had fallen out with the Soviet scientific establishment, who didn’t look kindly on his adherence to Gregor Mendel’s theory of genetic inheritance. Belyaev hoped to be able to continue his research away from prying eyes.

Belyaev started with the fox, Vulpes vulpes, a distant cousin of the dog. He took a pack of 100 females and 30 males, specially chosen from thousands kept in captivity on an Estonian fur farm. He selected his foxes based on a single trait: tameness, which he measured by their capacity to tolerate human proximity without fear or aggression. Only 5 per cent of the tamest males and 20 per cent of the tamest females were allowed to breed.

Within a few generations, Belyaev started noticing some odd things. After six generations, the foxes began to wag their tails for their caretakers. After 10, they would lick their faces. They were starting to act like puppies. Their appearance was also changing. Their ears grew more floppy. Their tails became curly. Their fur went from silver to mottled brown. Some foxes developed a white blaze. Their snouts got shorter and their faces became broader. Their breeding season lengthened. These pet foxes could also read human intentions, through gestures and glances.

In the wild, it paid to be skittish. But under human management, animals who could handle stress with equanimity did best

The Belayaev farm experiment has now been running for nearly 60 years. The foxes display virtually all the features of ‘domestication syndrome’ – the constellation of disparate characteristics that Darwin first spotted in mammals. All this came about surprisingly quickly, and by selecting for just a single trait: tameness.

What the Belayaev results suggest is that the manifold aspects of domestication might have a common cause in a gene or set of genes, which occur naturally in different species but tend to be selected out by adaptive and environmental pressures. However, the precise mechanism underlying the genetics of domestication syndrome remains unclear. One recent hypothesis suggests that the genetic key might lie in what are called neural crest cells. These cells appear very early in the development of the embryo and then migrate through the body, turning into all kinds of important tissues, including tail cartilage, ear cartilage, pigment cells, and tissues in the adrenal glands, teeth, jaws and much of the skull. A change in any one of the many genes regulating the migration and development of neural crest cells could be the key responsible for the domestication syndrome in animals.

Domestication does come at a certain cost to the animals involved. Most tame mammals have brains that are noticeably punier than those of their wild relatives. Brains of domestic pigs are 35 per cent smaller than those of boars, for example, while dogs’ brains are around 30 per cent smaller than those of wolves. However, it isn’t clear whether this shrinkage translates into lower intelligence. Much of the reduction appears to occur in parts of the brain related to motor control and sensory processes, such as vision and smell. And it was probably advantageous for domestic animals to have reduced sensory acuity. In the wild it paid to be skittish, while under human management, those individuals who could handle stress with equanimity did best.

The process appears to be very hard to reverse, however. Dingoes have been wild in Australia for more than 3,000 years and retain the smaller brains of their domesticated ancestors. The same holds true for feral pigs, even those that have lived away from human control for hundreds of years.

In all this time that we’ve had animal companions, what have they been doing to us? The ability to digest milk into adulthood is one of the most striking examples of how we’ve been affected by domestication. Known as ‘lactase persistence’, a term that refers to the enzyme that breaks down lactose in milk, it’s one of the greatest evolutionary adaptations in any species of the past few thousand years. Tolerance developed in humans at least five times, once in Europe and four times in areas of sub-Saharan Africa. It came about only after people dedicated themselves to pastoralism, and received year-round supplies of milk from domesticated cows, horses or sheep – although studies of ancient human DNA suggest that humans might have been consuming milk (uncomfortably) for thousands of years before our bodies finally learned to metabolise it.

Agriculture also brought humans into contact with thousands of new pathogens. Living in proximity to mammals and birds exposed humans to new species of flu and other viruses. Clearing land for crops in the tropics created standing pools of water, which served as perfect habitats for the mosquito species that carried yellow fever and malaria. Possession of the sickle cell variation and other genetic traits associated with haemoglobin irregularities in the blood appear to have arisen as a defence against these insect-borne illnesses.

Domestication means replacing a relationship founded on trust with one ‘based on domination’

Perhaps the most profound changes aren’t to our genes, but to our morals. On one hand, keeping pets has created new forms of cross-species intimacy. Dogs have been used for hunting since before the end of the last Ice Age 12,000 years ago. Excavations on Cyprus revealed that cats were being kept as pets as far back as 9,500 years ago, while archaeologists investigating one of the world’s first villages, Çatalhöyük in Turkey, found a man buried alongside a lamb in a pose that suggested kinship.

Keeping pets meant inviting animals into the family. It also created new relationships of inequality. The anthropologist Tim Ingold at the University of Aberdeen in Scotland, who has spent years studying the reindeer herders of Lapland, argues that it is a mistake to regard domestication as a form of progress, from living in opposition to nature to harnessing it for our benefit. In The Perception of the Environment (2000), he notes that foraging peoples generally regard animals as their equals. Hunting is not a form of violence so much as a willing sacrifice on the part of the animal. Pastoralists, on the other hand, tend to regard animals as servants, to be mastered and controlled. Domestication doesn’t entail making wild animals tame, Ingold says. Instead, it means replacing a relationship founded on trust with one ‘based on domination’.

When humans start treating animals as subordinates, it becomes easier to do the same thing to one another. The first city-states in Mesopotamia were built on this principle of transferring methods of control from creatures to human beings, according to the archaeologist Guillermo Algaze at the University of California in San Diego. Scribes used the same categories to describe captives and temple workers as they used for state-owned cattle.

Top-down domination no longer defines the horizon of what we can do to animals. The AquAdvantage Salmon, for example, is a genetic hybrid cooked up by scientists using two different salmon species and an eelpout fish. It matures twice as fast as regular salmon, and was approved for public consumption by the US Food and Drug Administration just over a year ago. Even newer is CRISPR gene-editing technology, which allows humans to directly modify genomes without the need for mediating external genes – holding out the promise of hypoallergenic eggs, disease-resistant livestock, infertile malarial mosquitoes, and pet micro-pigs with customisable coats.

However we choose to use this technology, it’s likely that anything we do to animals will reflect back on us too. CRISPR has just been approved for testing on humans. If Algaze and Ingold are right, and subjugating animals paved the way to slavery and the state, what will today’s factory farms do to societies of the future? How will opening up the genome of our companion species affect how we think about humans’ genetic code? ‘Judging from the past, we may safely infer that not one living species will transmit its unaltered likeness to a distant futurity,’ Darwin wrote towards the end of On the Origin of Species. That sentence is true of all creatures, but truest, perhaps, of humans.