If you’re a male chimp looking for love—or offspring—it pays to make friends with other males.

A study led by the University of Michigan, in collaboration with Arizona State and Duke universities, examined why male chimpanzees form close relationships with each other, and found that male chimpanzees that build strong bonds with the alpha male of the group, or with a large network of other males, are more successful at siring offspring. The results are published in the journal iScience.

“One big question that biologists have had for a long time is why you see so many friendly behaviors such as cooperation and alliance in animals,” said lead study author and U-M postdoctoral researcher Joseph Feldblum. “One would expect to see these social bonds—or strong, friendly social relationships—only if they provide some sort of fitness benefit to the individuals. Males wouldn’t spend all this time grooming other males and forgoing trying to find females or food unless you get some kind of benefit from it.”