The strange social structure of tiny fish called emerald coral gobies may be explained by family loyalty, new research shows.
Coral goby groups contain a single breeding male and female and - as "sequential hermaphrodites" - the subordinate gobies can take over either role if one of the breeders dies.
The puzzle for biologists is why breeders tolerate the smaller non-breeders sharing their space and competing for food.
One explanation is "kin selection" (favouring related individuals).
Reef fish are often assumed to disperse at random after hatching, meaning groups of adults should not be closely related, but the new study finds "positive relatedness" among gobies living close together.
"Groups of emerald coral gobies have a fixed structure in which the breeders are biggest," said lead author Dr Theresa Rueger, of the University of Exeter and Boston University.
"The rest are not sexually mature, and they are even known to refrain from eating to avoid threatening the rank above them in the social order.
"They can't risk being evicted from the group, as this usually means being eaten by predators on the reef."
Dr Rueger added: "Kin selection is commonly seen in birds and mammals, and our study demonstrates the potential for weak kin selection among coral gobies.
"In essence, it makes evolutionary sense to favour a distant cousin over an unrelated individual."
The researchers examined the genes of 73 gobies from 16 groups in Kimbe Bay, Papua New Guinea, and estimated relatedness among all individuals.
They found that gobies were significantly more related to members of their group than to gobies on the wider reef, and gobies in each reef were significantly more related to each other than to those from different reefs.
Like many reef fish, gobies spend their early life in the open ocean - where predators are larger and may not hunt tiny prey - before returning to a reef.
It might be assumed that the movement of larvae is dictated by ocean currents, but recent research has shown they have some ability to select currents and may therefore be able to return to the reef they came from - explaining relatedness among fish on a reef.
Previous research has explained why non-breeders tolerate their situation; gobies join groups for safety, and must then work their way up the social structure or risk eviction and death.
The new study finally offers an explanation for why breeders tolerate non-breeders that share their resources.
The research team included Cornell University and the University of Wollongong.
This project has received funding from the European Union's Horizon 2020 research and innovation programme under the Marie Sklodowska-Curie grant agreement No 841263.
The paper, published in the journal Molecular Ecology, is entitled: "Genetic relatedness in social groups of the emerald coral goby Paragobiodon xanthosoma creates potential for weak kin selection."