Best bee-lieve this is a giant honeybee nest. Muhammad Mahdi Karim / Wikimedia

Gerald Kastberger’s obsession with giant honeybees began in 1990, when he saw them nesting in an Indian fig tree. Unlike the more familiar western honeybee, which nest in holes or artificial hives, the two-centimeter-long giants live in the open. Each colony builds a single, meter-wide comb that hangs from branches, cliffs, or buildings. Tens of thousands of workers swarm over the comb, creating a living curtain of bees, up to seven individuals thick.

This open-nesting lifestyle comes with two big problems. First, the bees are vulnerable to predators. Wasps and hornets can swoop in and pluck workers from the edge of the curtain. Second, they have a heating problem. Even though their nests are exposed to the sun and the vagaries of the elements, the workers have to carefully control the interior temperatures to stop their larvae from either baking or freezing.

The bees clearly have solutions to these problems, because they’ve been around for at least 12 million years. And over the past 26 years, Kastberger has discovered what they do.

He noticed that whenever a hornet gets within 50 centimeters of a giant honeybee nest, the bees shimmer. Individual workers raise their abdomens by 90 degrees and shake them in unison. When one starts, its neighbors continue, and a mesmerizingly beautiful wave of booty-shaking bees ripples across the comb. “It’s analogous to the waves in football stadiums,” says Kastberger. True, although it’s more of a twerk than a wave.

After a few shimmers, the bees release a chemical called Nasonov pheromone, which stops their comrades from breaking ranks. Giant honeybees are naturally aggressive, so there’s always a chance that the workers would fly off to try and engage the enemy on their own. That would be a mistake: even a giant bee is no match for a hornet in the air. But a team that stands its ground is almost invincible. Their waves seem to befuddle and distract the incoming hornets, forcing them to veer off course and retreat. Kastberger filmed more than 450 attacks, and not a single one was successful.

If a hornet actually manages to land on the nest, the bees gang up on it. They clamber over the intruder and vibrate their wing muscles, raising their temperatures to 113 degrees Fahrenheit. They can take the heat but the hornets cannot. They are literally cooked to death by their prey.

This ability to manipulate temperature isn’t just useful for killing hornets. The bee larvae thrive best at 95 degrees Fahrenheit, so the workers do all they can to keep the nest at that precise temperature. They can heat sections by vibrating their flight muscles—the same trick they use to kill hornets. Conversely, they can cool sections by regurgitating water, which then removes heat as it evaporates. They can fan their nests with their wings to create cooling currents of air. And they might have an even more astonishing trick up their abdomens.

By filming the bees with a heat-sensitive infrared camera, Kastberger noticed that cool spots regularly appear across the surface of the nests. They’re more common in the heat of the afternoon, they can be up to 10 degrees colder than the surrounding areas, and they extend deep into the nest’s interior. It seemed that the bees were allowing ambient air to flow through their ranks to cool their combs. How?

Fanning is an obvious answer, but the wrong one. Kastberger showed that fanning workers can produce airstreams they cool the surface of the nest, but these currents are never strong enough to reach the interior. “A fanning bee in front of your face couldn’t possibly produce an airstream that flows into your lungs,” he notes.

Instead, he believes that the entire colony acts like a lung. If the workers push their legs against the comb, the entire curtain would arch outwards, lowering the pressure inside the comb and drawing fresh, cool air in—the nest inhales. When the bees relax, the curtain closes down and stale, warm air inside the comb is pushed out—the nest exhales. By moving together like a diaphragm composed of thousands of bodies, the bees can ventilate and cool their homes.

Everything that Kastberger measured—the rhythms of the cool spots, the flow of air around the hive, and the volume of the curtain—fits his hypothesis. Still, he hasn’t yet confirmed that the workers truly breathe en masse. “it’s an intriguing idea, but with no direct evidence,” says Benjamin Oldroyd from the University of Sydney. “Obtaining direct evidence will be difficult because the comb surface of these nests are shrouded by a thick layer of bees, meaning the surface is dark.  Moreover, these bees are extremely defensive.  I guess medical cameras could do the trick.”

“The analogy to mammalian nostrils really emphasizes the collective physiology of each colony,” says Miriam Richards from Brock University. Through their collective and coordinated, the giant honeybee colony  behaves like a single body—a super-organism. So do other social insects. Many ants and termites build nests with air-conditioning systems that can automatically suck in fresh air and expel stale air. “Nest ventilation is one of the prime examples of superorganismal behavior,” Richards adds. “It is quite amazing that these activities seem to be based on pretty simple behavioral rules followed by individuals.”

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.