A new study found that gay men may be predisposed to nurture their nieces and nephews as a way of helping to ensure their own genes get passed down to the next generation.

But scientists have been puzzled about how these genes are perpetuated, since gay males are less likely to reproduce than straight males. Basically, why haven’t gay people gone extinct?

One idea is called the “kin selection hypothesis.” Perhaps gay men are biologically predisposed to help raise the offspring of their siblings and other relatives.

“Maybe what’s happening is they’re helping their kin reproduce more by just being altruistic towards kin,” said evolutionary psychologist Paul Vasey of the University of Lethbridge in Canada. “Kin therefore pass on more of the genes which they would share with their homosexual relatives.”

Vasey and his student Doug VanderLaan tested this hypothesis among a group of men called fa’afafine on the Pacific island of Samoa. Fa’afafine are effeminate men who are exclusively attracted to men as sexual partners, and are generally recognized and tolerated as a distinct gender category ‚Äî neither male nor female.

The researchers surveyed about 300 fa’afafine, and found that they were significantly more likely to be altruistic toward their nieces and nephews than either single men or women, or mothers or fathers. The scientists call this behavior avuncular, or uncle-like.

The fa’afafine reported being much more willing to pay medical and school fees for their nieces and nephews, to help them with homework, babysit, teach them songs and dances. And a follow-up study confirmed that fa’afafine had indeed spent more money on their young relatives than straight people.

“I am convinced that the fa’afafine have significantly higher avuncular tendencies than men and women,” Vasey told LiveScience. “And [the] latest batch of data seems to indicate that this manifests in [the] real world.”