In a gray, linoleum-floored laboratory in Vienna, two dogs sit in side-by-side enclosures. One dog pulls a handle, and a tray laden with sausage moves down to where the other dog can reach it and excitedly gulp it down. How many times the first dog does this—giving a gift to another, with no benefit to itself—is a measure of what cognition researchers call “prosociality,” or, in essence, generosity. Specifically, how many times it gives food to a friend, or a strange dog, or just offers it to an empty enclosure can help researchers understand whether prosociality exists in dogs, part of a larger quest to understand which creatures are capable of generosity and how and when the trait evolved.

In the past, the Messerli Research Institute scientists who run this particular facility at University of Vienna have found that pet dogs give more to their friends—dogs who live in the same house with them—than to strangers. That fits with the idea that prosociality reinforces social bonds and may have evolved because it contributes to cooperation.

In a new study, however, they report that changing the procedure from simple handle-pulling to a more complex task gives different results. With this task—dogs touching buttons with their noses, cuing a researcher to slide a plate of food under the barrier to the other chamber—dogs still give more to friends than strangers. But, they also give food to an empty chamber when a friend or a stranger is leashed nearby.