Grooving together takes on greater meaning when we look more closely at brain function.

Today we associate “group fitness” with getting sweaty alongside twenty others in a tabata class or spinning away elbow-to-elbow to driving beats on stationary bicycles in a dark room. Yet the term has a much older connotation in anthropology, which in turn offers meaning to its modern mainstream usage.

Group fitness (also called group exercise or group training) refers to an evolutionary social adaptation by which groups of people prove to be stronger than individuals. It has been argued that human beings came to rule the animal kingdom thanks to social cognition: working together for the betterment of the group.

In the field of biology, there is debate about how much the group has mattered to our genetic code. But, the fact that it does matter is without question. Our systems of communication, rituals and hunting abilities were all born of and solidified within the group. British anthropologist Robin Dunbar famously speculated on the ideal size of a human social group, pegging it at roughly 150 members throughout most of history.

Today group fitness is a ritual itself. Jason Kelly, New York Bureau Chief at Bloomberg, believes that working out together is replacing religion for millions of people. In his book, “Sweat Equity: Inside the New Economy of Mind and Body,” he writes, “Fitness also has crept into a personal and social space once occupied by organized religion, and it’s not just yoga studios and meditation clubs.”

According to Kelly, the fitness industry accounts for more than $3 trillion in assets worldwide; health clubs pull in an annual $75 billion in revenue. In three decades the number of clubs increased by 600 percent in the United States, from 5,000 in 1981to 30,000 by 2012. Obviously, we have a need to connect to others.

Simply put, being around others feels good. Let’s investigate the evolution of the group through two independent yet interrelated phenomena, both of which apply to group fitness: movement and music.

Movement fosters bonds and empathy and helps bind complex social groups together.

Building a better brain

People moving together with the sole purpose of having fun and feeling good, as you might see in a HIIT class or by watching musicians on stage, elicits a connection going back to ancient times. And while it may seem optional, there appears to be a biological utility as well.

Both music and movement — I’m using this broader term instead of exercise, as all exercise involves movement — affect the processes of the brain that reward us with pleasure. They allow us to engage fully with others and to feel a deep emotional connection.

Opioids and hormones like serotonin are released when we listen to music, and movement releases the same chemicals and hormones. This profound biological process has evolved over eons in many animals to promote survival. Movement shapes the brain and helps make animals smarter and more adaptable. It also fosters bonds and empathy and helps bind complex social groups together. In humans, movement is at the center of how we learn to build our imagination, creativity, innovation and happiness. Doing so with others enhances the experience.

Likewise, music has aided humans in becoming the complex social animals we are today. Consider what a group fitness class would be like without the rhythmic tempo moving everyone along. Music seems to have strengthened community bonds and helped resolve conflicts. Because music comprehension is possible only in intelligent brains, neuroscientists like Dan Levitin believe music actually helped build our brains. Social interaction through music has been touted as a driving force behind the explosion in human brain size.

Professor of archaeology and psychology Steve Mithen believes music was used to build group identity through playing together. Playing music with others facilitates bonds between people who are related, as well as those who are not. He writes, “Music is about opening up and welcoming people. It is about conveying information, sharing emotions, soothing infants and all the ways to facilitate human interaction. Music could also then lead those groups into battle or bring them together in worship.” Or, move them through a half hour of tabata.

Neurobiologist and professor Loren “Larry” Parsons conducted early neurological research on musicians. They were scanned alone while playing their instrument, then together. When together their brains performed “complicated social work with a lot of millisecond decision planning,” occasionally synchronizing in peak demand. This pioneering study showed that “music is intrinsically social.”

The combination of music and movement not only helps us become strong and healthy, it enlarges our world by bringing us closer together.

Play together, stay together

This doesn’t only occur during performance. Listening to music together synchronizes brain states. When you’re grooving on your stationary bike, your brain is entrained to the beat, along with everyone else’s. This happens subconsciously. The combination of music and movement not only helps us become strong and healthy, it enlarges our world by bringing us closer together.

This sense of community has broader implications for a fitness class. We know we take classes to become physically stronger and more agile and flexible, but there’s an essential emotional component as well — one that is also facilitated through music with broader social consequences.

According to Levitin, our brains release emotionally charged neurochemicals such as dopamine, prolactin and the “trust hormone” oxytocin. When we identify with music’s expressive aspects and are awakened to the emotions it conveys, we experience music empathetically. And empathy is certainly an important quality to cultivate.

Music provokes emotions using the same neuronal mechanisms that we use to understand other people’s affective states. This occurs in the brainstem, hypothalamus and amygdala — the neural mechanisms that underlie empathy and caring. While processing our own emotional experiences, we learn to understand what another person is feeling. Music researchers discovered the same neural pathways used for empathy are activated when processing music.

This is why “community” is no misnomer when discussing fitness. The evolutionary pathways that ensured our success through group fitness continue to influence our tribes today. We might have different concerns than our ancestors, but then, as now, we rely on each other for health, prosperity and a sense of belonging in this world. Those who sweat together, stay together.