Every honeybee has a job to do. Some are nurses who take care of the brood; some are janitors who clean the hive; others are foragers who gather nectar to make honey. Collectively, honeybees are able to achieve an incredible level of sophistication, especially considering their brains are only the size of sesame seeds. But how are these jobs divvied up, and where do bees learn the skills to execute them?

Unlike in Jerry Seinfeld’s “Bee Movie,” real honeybees don’t go to college and get a job assignment from an aptitude officer upon graduation. Instead, they rely on a mixture of genetics, hormones, and situational necessity to direct them. Honeybees are born into an occupation, and then their duties continually shift in response to changing conditions in the hive.

“The jargon we use is that it’s ‘decentralized.’ There’s no bee in the center organizing this,” says Thomas Seeley, author of the book Honeybee Democracy. “Each bee has its own little set of rules, and the labor is sorted out by the bees following their rules.”

Born this way

A bee’s job is determined by its sex. Male bees, or drones, don’t do any work. They make up roughly ten percent of the colony’s population, and they spend their whole lives eating honey and waiting for the opportunity to mate. When the time comes for the queen to make her nuptial flight, all the drones in other colonies will compete for the honor of insemination. They fly after the queen and attempt to mate with her in mid-air. If they mate successfully, they fall to the ground in a victorious death. The queen will mate with up to twenty drones and will store their spermatozoa in her spermatheca organ for the rest of her life. That’s where male duties end.

Female bees, known as worker bees, make up the vast majority of a hive’s population, and they do all the work to keep it functioning. Females are responsible for the construction, maintenance, and proliferation of the nest and the colony that calls it home.

A bee’s sex is determined by the queen, who lays eggs at a rate of 1,500 per day for two to five years. She has the unique ability to designate which eggs will develop into female workers and which will become male drones.

Watch Related - Amazing Time-Lapse: Bees Hatch Before Your Eyes

If the queen approaches a smaller worker bee cell to lay a female egg, she will fertilize the egg on its way out by releasing spermatozoa from her nuptial flight. She has enough spermatozoa stored in her abdomen to last the duration of her life.

If the queen approaches a larger drone cell to lay a male egg, on the other hand, she will not release any spermatozoa as the egg leaves her ovaries. This unfertilized egg will develop into a drone.

Domestic duties

It takes 21 days for the worker bee to grow out of her larval state and leave the cell. When she emerges on day 21 as an adult bee, she will immediately start cleaning the cell from which she hatched. Her first three days will be spent cleaning cells to prepare them for the queen’s next round of eggs.

After three days, her hormones kick in to initiate the next phase of work: nursing the young. Seeley explains that hormones are released to activate different parts of the bee’s genes assigned to different tasks. “It’s similar to when humans get sick,” he says. “Sick genes that are involved in inflammation and fever get turned on. Likewise with bees and their jobs.”

A worker bee will spend about a week nursing the brood, feeding larvae with royal jelly, a nutritious secretion that contains proteins, sugars, fats, and vitamins. The exact number of days she spends on this task depends on where the hive needs the most attention. Bees are very sensitive organisms whose hormones are closely tied in with the colony’s needs. “A colony of honeybees is, then, far more than an aggregation of individuals,” writes Seeley in Honeybee Democracy. “It is a composite being that functions as an integrated whole.” The colony is a well-oiled superorganism, similar to ant and termite colonies.

The most dangerous job

When the bee is finished nursing, she will enter the third phase, as a sort of utility worker, moving farther away from the nest’s center. Here she will build cells and store food in the edge of the nest for about a week.

A bee’s hormones will shift into the final phase of work at around her 41st day: foraging. This work is the most dangerous and arguably the most important. It’s only done by older bees who are closer to death. As Steve Heydon, an entomologist at the University of California, Davis, puts it, “You wouldn’t want the youngest bees doing the most dangerous job.” If too many young bees die, then the hive wouldn’t be able to sustain itself.

As the worker bee approaches her fourth week of nonstop work, she will sense her end of days and remove herself from the hive, so as not to become a burden. If she dies in the hive, her fellow bees would have to remove her corpse.

Thus is the life of a female bee during the active seasons of spring and summer, compulsively working from the day she’s born until the day she dies. It’s a thankless life of nonstop work, but honeybees, as a result, are some of the most successful collaborators we’ve found in nature.