Once upon a time, the sun and moon argued about who would light up the sky. They fought, as anthropomorphic celestial bodies are meant to do, but after the moon proves to be as strong as the sun, they decide to take shifts. The sun would brighten the day, while the moon would illuminate the night.

This is one of several stories told by the Agta, a group of hunter-gatherers from the Philippines. They spend a lot of time spinning yarns to each other, and like their account of the sun and moon, many of these tales are infused with themes of cooperation and equality. That’s no coincidence, says Andrea Migliano, an anthropologist at University College London.

Storytelling is a universal human trait. It emerges spontaneously in childhood, and exists in all cultures thus far studied. It’s also ancient: Some specific stories have roots that stretch back for around 6,000 years. As I’ve written before, these tales aren’t quite as old as time, but perhaps as old as wheels and writing. Because of its antiquity and ubiquity, some scholars have portrayed storytelling as an important human adaptation—and that’s certainly how Migliano sees it. Among the Agta, her team found evidence that stories—and the very act of storytelling—arose partly as a way of cementing social bonds, and instilling an ethic of cooperation.

At first, Migliano wasn’t actually interested in storytelling. She wanted to know what qualities the Agta most value in their peers, given that they are nomadic and their camps continuously shift. So, her students asked 300 Agta to name the five people they’d most want to live with. They also asked the volunteers to nominate the strongest people they knew; the best hunters, fishers, and foragers; the ones whose opinions are most respected; and the ones with most medical knowledge. And finally, almost as an afterthought, they asked the volunteers to name the best storytellers. That, they assumed, was something relatively unimportant, and would make for an interesting contrast against the other more esteemed skills.

In fact, the Agta seemed to value storytelling above all else. Good storytellers were twice as likely to be named as ideal living companions as more pedestrian tale spinners, and storytelling acumen mattered far more all the other skills. “It was highly valued, twice as much as being a good hunter,” says Migliano. “We were puzzled.”

Fortunately, she had been working with Agta Aid, a nonprofit organization that had been trying to preserve the Agta’s oral stories in written forms. “We asked them if we could have a look at the stories they were collecting, and we realized that most of the content was about cooperation, egalitarianism, and gender equality.” The male sun and female moon divvy up the sky. A pig helps its injured friend—a sea cow—into the ocean so they can race side by side. A winged ant learns that she is not above her other wingless sisters.

These themes aren’t unique to the Agta. They’re also present in around 70 percent of the stories that Migliano compiled from work with other hunter-gatherer groups. “Hunter-gatherers move around a lot and no one has particular power,” she explains. “You need ways of ensuring cooperation in an egalitarian society, and we realized that you could use stories to broadcast the norms that are important to them.” People can use religion to achieve a similar end, enforcing good behavior through fear of a punitive deity. But Migliano points to research suggesting that high gods are a relatively recent invention, which emerged once human societies became large. Small communities like the Agta don’t have them. Instead, they use stories for the same purpose.

Migliano’s team asked Agta volunteers from various camps to play a simple game, in which they could share rice with their camp-mates. And they found that such sharing was more likely in camps with a higher proportion of good storytellers.

That’s just a correlation, though. It’s possible that the storytellers were actively fostering more generosity among their peers. Alternatively, Migliano says, “if you live in a more cooperative camp, perhaps you have more time and you just tell more fun stories.” But if that’s true, she adds, it wouldn’t explain why so many of the actual stories feature leitmotifs of cooperation, rather than other happy and positive themes. And it certainly doesn’t explain why storytelling skill is so beneficial for those who wield it.

Skilled Agta storytellers are more likely to receive gifts, and they’re not only more desirable as living companions—but also as mates. On average, they have 0.5 more children than their peers. That’s a crucial result. Stories might help to knit communities together, but evolution doesn’t operate for the good of the group. If storytelling is truly an adaptation, as Migliano suggests, it has to benefit individuals who are good at it—and it clearly does.

“It’s often said that telling stories, and other cultural practices such as singing and dancing, help group cooperation, but real-world tests of this idea are not common,” says Michael Chwe, a political scientist at the University of California, Los Angeles, who studies human cooperation. “The team’s attempt to do this is admirable.”

Still, it’s hard to know if it’s the specific act of storytelling that matters. As others have noted, “creativity comes with its own suite of personality traits, which may make [people] more attractive sexual partners,” says Lisa Zunshine, an English professor at the University of Kentucky.

And all of Migliano’s results hinge on the Agta accurately naming the best storytellers in their midst. Did they? Could they just have named people they were close to, or venerated celebrities who sprang readily to mind? Wouldn’t that explain both the fecundity and desirability of these supposed storytelling Jedi? Migliano thinks not. If the survey had been a mere popularity contest, the Agta should have also nominated the same people as exceptional hunters, gatherers, child minders, and so on. They didn’t. They singled out particular people for particular skills, including storytelling.

“It suggests that hunter-gatherers track this ability and perceive it as beneficial,” says Michelle Scalise Sugiyama from the University of Oregon, who has studied the origins of storytelling. Other societies, like the Tsimane of Bolivia, do the same, which “indicates that storytelling contributes something of adaptive value to human life.” That something might well be the reinforcement of norms and ethics. “As attested by the universality of the trickster figure, telling stories about rule breakers who get caught and punished is an effective means of persuading individuals to conform to group norms,” Scalise Sugiyama adds.

But “stories also contain valuable cultural knowledge, and accomplished storytellers are repositories of this knowledge,” she notes. Hunter-gatherers use their tales to pass down information about food, weather, and more—and often in ways that outsiders can miss.

For example, Andamanese people have a story about two quarreling weather gods, who eventually split up their wind-creating duties. You could see that as a story about avoiding conflict, or as a way of encoding information about the strong winds that buffet the Andaman Islands. A similar creation story talks about a monitor lizard that went into the jungle to hunt pigs, got stuck in a tree, and was helped down by a civet cat (whom it married). On the face of it, that’s a story of cooperation between the sexes. But Scalise Sugiyama notes that it also encodes information about the habitat, diet, and range overlaps between the local lizards, pigs, and civets. “These profiles may aid in the prediction of animal behavior, which is critical to locating, tracking, and stalking game,” she says.

This is not to say that people deliberately or consciously tell stories to pass down knowledge or to keep their communities together. “My guess is that they would say it’s fun,” says Migliano. That’s why individuals choose to tell stories on a moment-to-moment basis—it’s what biologists call the “proximate cause” of a behavior. But it’s the broader benefits—the “ultimate causes” like transmission of knowledge or inculcation of values—that might explain why storytelling arose in the first place.

The origin of storytelling doesn’t necessarily reflect its later uses, though. “Our very human love of stories has become adapted for different ends during later phases of human history,” says Sarah Blaffer Hrdy, an anthropologist from the University of California, Davis. “The Maya-speaking people I used to study in southern Mexico told tales about a winged, super-sexed demon with a six-meter-long, death-dealing penis, who reinforced proper sex roles for men and women, including proscriptions for postures during sex, menstrual taboos, freedom of movement. Rather than promoting sexual equality, these served to constrain women.”

“Alas, our wonderfully human universal of loving stories can also become an all-too-human vulnerability, fostering enmity as readily as amicable relations,” she adds.