On the Friday before Christmas, a customer at a coffee shop in Winnipeg, Canada, spontaneously decided to pay for the drink of the next customer – and that stranger, moved by this act, did so for the next, ultimately creating a chain of 228 customers who paid for the person behind them.

They’re not the only ones who spread edible good cheer. Bonobos will break bread with strangers just to make their acquaintance – and may even be more generous with strangers than with their peers, new research on captive primates at a Congolese sanctuary shows. They'll sometimes help strangers out even with no chance of meeting them -- though that generosity has its limits.

The research, published Monday by the journal PLoS ONE, could help scientists better understand the evolutionary roots of humans' social network forming tendencies. 

Bonobos, together with chimpanzees, are two of modern humans' closest genetic relatives. Unlike chimpanzees, however, which often violently attack outsiders, bonobos are generally more peaceful and will even travel with bonobos from outside groups for days at a time while foraging. 

In a series of experiments, a pair of researchers from Duke University showed that bonobos had 'xenophilic' tendencies – they tended to help bonobos they didn’t know over those who were from their own social group.

When presented with a pile  of food and given the option to open a door and let another bonobo in to share the meal, bonobos did so, and -- when given the choice between a stranger and a groupmate -- preferred sharing with the strangers.

"Bonobos may be unique among apes in preferring to interact with strangers over groupmates even at the cost of sharing food," the study authors write.

And, in what the authors called a "surprising" twist, if a bonobo chose to let a stranger in to share a meal over a groupmate in an adjoining room, the freed stranger would often go and open the groupmate's cage even though the stranger would now be outnumbered by two unknown bonobos, and the food would be further split between them. 

There’s clear self-interest in many of these cases because, as the study authors put it, “More social effort is needed to improve an existing relationship than to establish a completely new relationship.”

But there were limits to this goodwill. Another experiment showed that if there was no hope of meeting a bonobo, whether establishing a new relationship or improving an old one, then the bonobos' generosity quickly fizzled out. If the bonobos were allowed to choose between reaching for the food or letting another bonobo reach the food in a completely separate room, they chose to grab the grub for themselves.

And yet, another experiment showed that the tendency to help others wasn’t entirely selfish: Bonobos would help others get food that was out of reach for both of them, even if they got no social interaction out of it. If bonobos could pull a rope to let another bonobo into that separate room to eat it, they would do so – even though they had no hope of meeting the recipient. Between a choice of letting another bonobo eat, or neither bonobo eating at all, the subject bonobo chose to let someone get a meal.

In humans, they added, such behaviors probably aided in the development of “an expanded social network of unrelated individuals, which further enabled cumulative culture and cooperation.”

Follow me on Twitter @aminawrite.