It sounds like a science fiction story starring beetles: a queen beetle, or “foundress”, establishes a colony in the trunk of a live eucalyptus tree. She excavates tunnels and establishes a fungus garden with the help of her sterile worker sisters.

The foundress is known as “life-time inseminated”, living on stored sperm from one original male. Some 90% of foundresses fail in their attempts to establish a colony. They are preyed upon, or trapped by tree sap covering the entrance tunnel.

However, once the colony is established, the diminutive queen may live for 10, 20 or even 30 years – making the Australian wood-boring ambrosia beetle (Austroplatypus incompertus) probably the longest-lived in the world.

It is also the only known beetle species that is eusocial – that is, like ants, bees and termites, it lives in a multi-generational colony of tightly related members, and exhibits cooperative care of juveniles.

In a gruesome twist, the hard work of tunnel excavation results in the loss of the claws and most of the leg segments of both the foundress and her legion of female workers, effectively imprisoning them in the tree.

Eusociality has evolved multiple times in the animal kingdom, and is characterised by the tension between the drive for an individual to perpetuate genes, or forgo this opportunity for the greater good of the group.

Researchers have long known that ambrosia beetle colonies have unfertile workers, but the details of the lifestyle and relatedness of the beetles have remained unclear.

Now, however, a team led by Shannon Smith from Australia’s Western Sydney University has succeeded in demonstrating that each colony comprises a single family, with unmated females and juveniles all full siblings to each other, and all the daughters of the queen.

“We know that bees, ants and termites have castes, with particular roles they might carry out for life,” says Smith.

“In the most extreme case, we see individuals give up the chance to reproduce to serve the colony. This is the first time we’ve described the details of this advanced form of sociality in a beetle, despite there being close to 400,000 species of beetles in the world.”

Smith and her colleagues wondered how the colony structure evolved.

“Lifelong devotion of workers is likely key to establishing and surviving in this challenging environment, inside a living tree, and we wanted to understand what drives these beetles to organise their social colony life in this way,” she says.

“Why do these worker beetles give up their opportunity to ever reproduce?”

In order to answer that question, the team, including co-author Deborah Kent, Macquarie University’s Adam Stow and Jacobus Boomsma from the University of Copenhagen, conducted a detailed study of 468 ambrosia beetle colonies, known as galleries, and the genetic composition of 559 specimens (including workers, pupae, larvae and eggs) from 33 galleries.

The researchers confirmed that each colony is established by a single queen who has only been inseminated by a single male.

“Our work confirms that high relatedness among colony members was first needed for a social system with sterile worker castes to evolve,” says Stow.

The research demonstrates that the evolution of sterile workers comes about through parental monogamy, and very close relatedness between members in a colony.

Stow continues: “In short, by helping your closest possible relatives, you’re helping to pass on your own genes as effectively as when you would reproduce yourself. Once you have this high relatedness established in each colony, then the ecological conditions kick in, with the family members cooperating to survive and thrive long-term, despite the tough conditions inside a living tree.”

Indeed, the conditions are brutal, and result in the universal loss of almost all tarsal segments and the all-important claws essential for ambrosia beetle movement.

This is the key to the beetles being examples of “obligate” eusociality, where sterile workers have no opportunity to breed. Only female ambrosia beetles born in the gallery and destined to leave the tree and become a foundress herself retains intact claws and legs.

“When it comes to ambrosia beetles, cooperation to the extent that you give up the ability to raise a family yourself will only occur amongst close relatives,” concludes Smith. “Family matters.”

The research was published in the journal Nature Ecology & Evolution.