On the front porch of an old Coast Guard station on Appledore Island, seven miles off the southern coast of Maine, Thomas Seeley and I sat next to 6,000 quietly buzzing bees. Seeley wore a giant pair of silver headphones over a beige baseball cap, a wild fringe of hair blowing out the back; next to him was a video camera mounted on a tripod. In his right hand, Seeley held a branch with a lapel microphone taped to the end. He was recording the honeybee swarm huddling inches away on a board nailed to the top of a post.

Seeley, a biologist from Cornell University, had cut a notch out of the center of the board and inserted a tiny screened box called a queen cage. It housed a single honeybee queen, along with a few attendants. Her royal scent acted like a magnet on the swarm.

If I had come across this swarm spread across my back door, I would have panicked. But here, sitting next to Seeley, I felt a strange calm. The insects thrummed with their own business. They flew past our faces. They got caught in our hair, pulled themselves free and kept flying. They didn’t even mind when Seeley gently swept away the top layer of bees to inspect the ones underneath. He softly recited a poem by William Butler Yeats:

I will arise and go now, and go to Innisfree,

And a small cabin build there, of clay and wattles made:

Nine bean-rows will I have there, a hive for the honey-bee,

And live alone in the bee-loud glade.

A walkie-talkie on the porch rail chirped.

“Pink bee headed your way,” said Kirk Visscher, an entomologist at the University of California, Riverside. Seeley, his gaze fixed on the swarm, found the walkie-talkie with his left hand and brought it to his mouth.

“We wait with bated breath,” he said.

“Sorry?” Visscher said.

“Breath. Bated. Over.” Seeley set the walkie-talkie back on the rail without taking his eyes off the bees.

A few minutes later, a honeybee scout flew onto the porch and alighted on the swarm. She (all scouts are female) wore a pink dot on her back.

“Ah, here she is. Pink has landed,” Seeley said.

Pink was exploring the island in search of a place where the honeybees could build a new hive. In the spring, if a honeybee colony has grown large enough, swarms of thousands of bees with a new queen will split off to look for a new nest. It takes a swarm anywhere from a few hours to a few days to inspect its surroundings before it finally flies to its newly chosen home. When Pink had left Seeley’s swarm earlier in the morning, she was not yet pink. Then she flew to a rocky cove on the northeast side of the island, where she discovered a wooden box and went inside. Visscher was sitting in front of it under a beach umbrella, with a paintbrush hanging from his lips. When the bee emerged from the box, Visscher flicked his wrist and caught her in a net the size of a ping-pong paddle. He laid the net on his thigh and dabbed a dot of pink paint on her back. With another flick, he let her go.

Visscher is famous in honeybee circles for his technique. Seeley calls it alien abduction for bees.

As the day passed, more scouts returned to the porch. Some were marked with pink dots. Others were blue, painted by Thomas Schlegel of the University of Bristol at a second box nearby. Some of the returning scouts started to dance. They climbed up toward the top of the swarm and wheeled around, waggling their rears. The angle at which they waggled and the time they spent dancing told the fellow bees where to find the two boxes. Some of the scouts that witnessed the dance flew away to investigate for themselves.

Then a blue bee did something strange. It began to make a tiny beeping sound, over and over again, and started head-butting pink bees. Seeley had first heard such beeps in the summer of 2009. He didn’t know why it was happening, or which bee was beeping. “All I knew was that it existed,” he said. Seeley and his colleagues have since discovered that the beeps come from the head-butting scouts. Now Seeley moved his microphone in close to them, calling out each time the bee beeped. It sounded like a mantra: “Blue...blue...blue...blue...blue.”

When you consider a swarm one bee at a time this way, it starts to look like a heap of chaos. Each insect wanders around, using its tiny brain to perceive nothing more than its immediate surroundings. Yet, somehow, thousands of honeybees can pool their knowledge and make a collective decision about where they will make a new home, even if that home may be miles away.

The decision-making power of honeybees is a prime example of what scientists call swarm intelligence. Clouds of locusts, schools of fish, flocks of birds and colonies of termites display it as well. And in the field of swarm intelligence, Seeley is a towering figure. For 40 years he has come up with experiments that have allowed him to decipher the rules honeybees use for their collective decision-making. “No one has reached the level of experimentation and ingenuity of Tom Seeley,” says Edward O. Wilson of Harvard University.

Growing up in Ellis Hollow, in upstate New York, Seeley would bicycle around the farms near his house; one day he discovered a pair of white boxes. They each contained a hive. Seeley was seduced. He came back day after day to stare at the hives. He would look into the boxes and see bees coming in with loads of pollen on their legs. Other bees fanned their wings to keep the hives cool. Other bees acted as guards, pacing back and forth at the opening.

“If you lie in the grass in front of a hive, you see this immense traffic of bees zooming out of the hive and circling up and then shooting off in whatever direction they want to go,” said Seeley. “It’s like looking at a meteor shower.”

For his PhD at Harvard, Seeley took up a longstanding entomological question: How do honeybees choose their homes? He climbed into trees and poured cyanide into hives to kill the honeybees inside. He sawed down the trees and measured the cavities. Seeley found that bee hive hollows were very much alike. They were at least ten gallons in volume, sat at least 15 feet off the ground and had a narrow opening.

Seeley built 252 wooden boxes of different shapes and sizes and scattered them in forests and fields to test how particular bees were about these qualities. Swarms only moved into boxes that had the same features that Seeley had found in their tree cavities. “It’s really important to get them all right,” Seeley said.

The architectural tastes of honeybees are not mere whims. If honeybees live in an undersized cavity, they won’t be able to store enough honey to survive the winter. If the opening is too wide, the bees won’t be able to fight off invaders.

He took his research to Appledore Island because no native honeybees live here, and it has no big trees where the insects could make their homes. Seeley and his colleagues would bring their own honeybees and nest boxes. “This is our laboratory,” Seeley said. “This is where we gain control.”

In one experiment, Seeley set up five boxes of different sizes. Four of the boxes were mediocre, by honeybee standards, while one was a dream home. In 80 percent of the trials, the swarms chose the dream home.

Through years of study, Seeley and his colleagues have uncovered a few principles honeybees use to make these smart decisions. The first is enthusiasm. A scout coming back from an ideal cavity will dance with passion, making 200 circuits or more and waggling violently all the way. But if she inspects a mediocre cavity, she will dance fewer circuits.

Enthusiasm translates into attention. An enthusiastic scout will inspire more bees to go check out her site. And when the second-wave scouts return, they persuade more scouts to investigate the better site.

The second principle is flexibility. Once a scout finds a site, she travels back and forth from site to hive. Each time she returns, she dances to win over other scouts. But the number of dance repetitions declines, until she stops dancing altogether. Seeley and his colleagues found that honeybees that visit good sites keep dancing for more trips than honeybees from mediocre ones.

This decaying dance allows a swarm to avoid getting stuck in a bad decision. Even when a mediocre site has attracted a lot of scouts, a single scout returning from a better one can cause the hive to change its collective mind.

“It’s beautiful when you see how well it works,” Seeley said. “Things don’t bog down when individuals get too stubborn. In fact, they’re all pretty modest. They say, ‘Well, I found something, and I think it’s interesting. I don’t know if it’s the best, but I’ll report what I found and let the best site win.’”

During the time I visited Seeley, he was in the midst of discovering a new principle. Scouts, he found, purposefully ram one another head-on while deciding on a new nest location. They head-butt scouts coming from other locations—pink scouts bumping into blue scouts and vice versa—causing the rammed bee to stop dancing. As more scouts dance for a popular site, they also, by head-butting, drive down the number of dancers for other sites.

And once the scouts reach a quorum of 15 bees all dancing for the same location, they start to head-butt one another, silencing their own side so that the swarm can prepare to fly.

One of the things Seeley has been thinking about during his vigils with his swarms is how much they’re like our own minds. “I think of a swarm as an exposed brain that hangs quietly from a tree branch,” Seeley said.

A swarm and a brain both make decisions. Our brains have to make quick judgments about a flood of neural signals from our eyes, for example, figuring out what we’re seeing and deciding how to respond.

Both swarms and brains make their decisions democratically. Despite her royal title, a honeybee queen does not make decisions for the hive. The hive makes decisions for her. In our brain, no single neuron takes in all the information from our senses and makes a decision. Millions make a collective choice.

“Bees are to hives as neurons are to brains,” says Jeffrey Schall, a neuroscientist at Vanderbilt University. Neurons use some of the same tricks honeybees use to come to decisions. A single visual neuron is like a single scout. It reports about a tiny patch of what we see, just as a scout dances for a single site. Different neurons may give us conflicting ideas about what we’re actually seeing, but we have to quickly choose between the alternatives. That red blob seen from the corner of your eye may be a stop sign, or it may be a car barreling down the street.

To make the right choice, our neurons hold a competition, and different coalitions recruit more neurons to their interpretation of reality, much as scouts recruit more bees.

Our brains need a way to avoid stalemates. Like the decaying dances of honeybees, a coalition starts to get weaker if it doesn’t get a continual supply of signals from the eyes. As a result, it doesn’t get locked early into the wrong choice. Just as honeybees use a quorum, our brain waits until one coalition hits a threshold and then makes a decision.

Seeley thinks that this convergence between bees and brains can teach people a lot about how to make decisions in groups. “Living in groups, there’s a wisdom to finding a way for members to make better decisions collectively than as individuals,” he said.

Recently Seeley was talking at the Naval War College. He explained the radical differences in how swarms and captain-dominated ships make decisions. “They realize that information is very distributed across the ship,” Seeley said. “Does it make sense to have power so concentrated? Sometimes you need a fast decision, but there’s a trade-off between fast versus accurate.”

In his experience, Seeley says, New England town hall meetings are the closest human grouping to honeybee swarms. “There are some differences, but there are also some fundamental similarities,” he said. Like scouts, individual citizens are allowed to share different ideas with the entire meeting. Other citizens can judge for themselves the merit of their ideas, and they can speak up themselves. “When it’s working properly, good ideas rise up and bad ones sink down,” says Seeley.

Groups work well, he argues, if the power of leaders is minimized. A group of people can propose many different ideas—the more the better, in fact. But those ideas will only lead to a good decision if listeners take the time to judge their merits for themselves, just as scouts go to check out potential homes for themselves.

Groups also do well if they’re flexible, ensuring that good ideas don’t lose out simply because they come late in the discussion. And rather than try to debate an issue until everyone in a group agrees, Seeley advises using a honeybee-style quorum. Otherwise the debate will drag on.

One of the strengths of honeybees is that they share the same goal: finding a new home. People who come together in a democracy, however, may have competing interests. Seeley advises that people should be made to feel that they are part of the decision-making group, so that their debates don’t become about destroying the enemy, but about finding a solution for everyone. “That sense of belonging can be nurtured,” Seeley said. The more we fashion our democracies after honeybees, Seeley argues, the better off we’ll be.

Carl Zimmer’s latest book is Science Ink: Tattoos of the Science Obsessed.