Older than civilization, music fosters communication, wellness, and bonding across all cultures—but where it comes from is disputed.

When Charles Darwin listened to music, he asked himself, what is it for? Philosophers had pondered the mathematical beauty of music for thousands of years, but Darwin wondered about its connection to biology. Humans make music just as beavers build dams and peacocks show off their tail feathers, he reasoned, so music must have evolved. What drove its evolution was hard for him to divine, however. “As neither the enjoyment nor the capacity of producing musical notes are faculties of the least direct use to man in reference to his ordinary habits of life, they must be ranked among the most mysterious with which he is endowed,” Darwin wrote in 1871.

Today a number of scientists are trying to solve that mystery by looking at music right where we experience it: in the brain. They are scanning the activity that music triggers in our neurons and observing how music alters our biochemistry. But far from settling on a single answer, the researchers are in a pitched debate over music. Some argue that it evolved in our ancestors because it allowed them to have more children. Others see it as merely a fortunate accident of a complex brain.

In many ways music appears to be hardwired in us. Anthropologists have yet to discover a single human culture without its own form of music. Children don’t need any formal training to learn how to sing and dance. And music existed long before modern civilization. In 2008 archaeologists in Germany discovered the remains of a 35,000-year-old flute. Music, in other words, is universal, easily learned, and ancient. That’s what you would expect of an instinct that evolved in our distant ancestors.

Darwin himself believed that music evolved as a primordial love song. In other species, males make rhythmic grunts, screeches, and chirps to attract mates. “Musical tones and rhythm were used by the half-human progenitors of man, during the season of courtship, when animals of all kinds are excited by the strongest passions,” he proposed in The Descent of Man. And today, 139 years later, some scientists still sign on to this interpretation.

Dean Falk of the School for Advanced Research in Santa Fe, New Mexico, and Ellen Dissanayake of the University of Washington at Seattle accept the idea that a predisposition to music is hardwired, but they think Darwin misunderstood its primary function. They suggest that music evolved not only to serve love but also to soothe its aftermath. Mothers coo to their babies in a melodious singsong sometimes called motherese, a behavior that is unique to humans. Motherese is much the same in all cultures; its pitches are higher and its tempo slower than adult speech. What’s more, motherese is important for forming bonds between mother and child. Falk and Dissanayake argue that the fundamentals of music first arose because it helped form these bonds; once the elements of music were laid down, adults were able to enjoy it as well.

A third faction holds that music evolved not from any one-on-one experience but as a way to bring groups together. Robin Dunbar, a psychologist at the University of Oxford, is now running experiments to test the idea that music evolved to strengthen the emotional bonds in small groups of hominids.

Dunbar has spent much of his career studying bands of primates. One of the most important things they do to keep the peace is groom one another. Grooming triggers the primate brain’s hypothalamus to release endorphins, neurotransmitters that ease pain and promote a feeling of well-being. Our early ancestors may have engaged in similar behavior. As humans evolved, though, they started congregating in larger groups. By the time the average group size hit about 150, grooming was no longer practical.

Music evolved, Dunbar proposes, because it could do what grooming could no longer do. Large gatherings of people could sing and dance together, strengthening their bonds. In a few studies, researchers have found that listening to music can raise the level of endorphins in the bloodstream, just as grooming can. Recently, Dunbar and his colleagues ran experiments to learn more about music’s soothing effects. If music was important for forging social bonds, then performing music (not just listening to it) might release endorphins too.

Dunbar and his colleagues studied people who played music or danced together in church groups, samba classes, drumming circles, and the like. After the performances, the scientists made an indirect measure of the endorphin levels in the performers’ bodies, putting blood pressure cuffs on people’s arms and inflating them until the subjects complained of pain. (Since endorphins kill pain, a higher pain threshold indicates elevated levels of the compounds.) The researchers then repeated the procedure with employees of a musical instrument store who listened passively to constant background music. People who actively moved their bodies to music—dancers, drummers, and so on—had elevated pain thresholds, but no such effect showed up among those who merely listened.

Aniruddh Patel, an expert on music and the brain at the Neurosciences Institute in La Jolla, California, finds Dunbar’s research unconvincing. If music evolved as a substitute for grooming, he notes, then you would expect that people with social impairments would have trouble with music. Those with autism have no trouble perceiving music, however. In fact, psychologist Rory Allen of Goldsmiths, University of London, has found that they have the same physical responses to emotional music that typical people do.

In rejecting music as an evolutionary adaptation, Patel carries on an old tradition. William James, the pioneering psychologist, declared in 1890 that music was “a mere incidental peculiarity of the nervous system.” Rather than evolving as some essential adaptation, it “entered the mind by the back stairs,” James wrote. Harvard psychologist Steven Pinker echoed this view in his 1997 best-selling book, How the Mind Works. “As far as biological cause and effect are concerned, music is useless,” he declared. Music is a by-product of how we communicate with each other—nothing more than “auditory cheesecake,” in Pinker’s words.

In the 13 years since Pinker coined that fetching phrase, neuroscientists such as Patel have collected evidence that supports the auditory cheesecake hypothesis, but only up to a point. When Patel and his colleagues examined the parts of the brain that handle different aspects of music—tone, rhythm, and so on—they found that there is no special lobe uniquely dedicated to those particular jobs. It looks as if music is riding the coattails of other parts of the brain that evolved for other functions.

In a chapter of the recent book Emerging Disciplines, Patel describes how that borrowing process might work. Listening to the tones in instrumental music, for example, activates language regions of the brain that also process words and syntax. Those regions may make sense of tones by parsing melodies almost as if they were sentences. To keep a beat, Patel’s research suggests, we co-opt the brain network that links our hearing and the control of our muscles. This network’s main job is to allow us to learn new words. When babies start learning to speak, all words are just arbitrary sounds. To match their own vocalizations to the words they hear, they need a way to precisely adjust their tongue and vocal cords to mimic the sounds of those words. As adults, we can use this connection between hearing and muscles to keep a beat—but that is merely a side effect of being able to imitate sound.

To explore these ideas, researchers are looking at animals that have the same skills. Vocal learning is rare in the animal kingdom. Only a few groups of birds and mammals can do it. Even our closest chimpanzee relatives can’t. Keeping a beat is rare as well. In recent experiments, Hugo Merchant and his colleagues at the National Autonomous University of Mexico tried to train rhesus monkeys to tap a button in sync with a metronome. The monkeys failed, even after thousands of trials.

Intriguingly, some birds can master rhythm. Since 2008 Patel and his colleagues have been studying a cockatoo named Snowball. He can dance to any music with a strong beat, although he seems particularly fond of Cyndi Lauper and the Backstreet Boys. Patel doesn’t think it is a coincidence that Snowball belongs to a lineage of birds that excel at vocal learning. Like us, Snowball may be borrowing his vocal learning equipment to dance. Patel concludes that music is a cultural invention, not an evolutionary adaptation.

Some victims of stroke lose the ability to speak, and for these people music can have an especially great benefit. In a treatment called melodic intonation therapy, stroke patients practice singing short sentences as they tap out the rhythm. Gradually they increase the length of the sung sentences until reaching the point where they can start to speak. Gottfried Schlaug, a neuro­scientist at Harvard Medical School, has found that melodic intonation therapy creates profound changes in the brain. In particular, it thickens a bundle of nerve fibers called the arcuate fasciculus, an information highway crucial for using language.Regardless of how it arose long ago, music can exert a powerful effect on the brain right now. The brains of longtime musicians are transformed by years of practice, much as playing basketball or juggling can rewire the brain. In the past couple of years, neuroscientists have discovered that simply listening to music can change the brain too. Last year Sylvain Moreno of York University in Toronto and his colleagues showed that giving third graders nine months of music classes improved their ability to read. In a 2008 study, Finnish psychologists had stroke patients spend two months listening to music. Six months later, the patients had better verbal memory and attention than stroke victims who had not had music therapy.