How generous is an ape? The answer could tell us a lot about ourselves.

While it is easy to dwell on our capacity for war, scientists see our generosity as a remarkable feature of our species. “One of the things that stands out about humans is how helpful we are,” said Christopher Krupenye, a primate behavior researcher at the University of St. Andrews in Scotland.

To understand the origin of this impulse, known as prosociality, researchers have turned to our closest living relatives. For example, a study involving bonobo apes suggests that the roots of human generosity run deep, but only came into full flower over the course of the evolution of our species.

Roughly 7 million years ago, our lineage split from the ancestors of chimpanzees and their cousin species, bonobos. Chimpanzees and bonobos share a common ancestor that lived about 2 million years ago. These two species of apes have evolved intriguing differences.

Krupenye and his colleagues found that in 18 percent of the trials, the bonobos given nuts handed one through a window to their neighbor. But the bonobos with rocks — a tool used to crack open palm nuts — almost never returned the favor.

On the other hand, chimpanzees rarely give away food, but are generous with tools. Chimpanzees live in habitats where food is often scarce but they have learned clever strategies for using tools to get food.

Bonobos, by contrast, live in forests where food is far more abundant. But they are also less adept with tools. Bonobos may have become more tolerant of each other. They recognize the value of food to others, and do not feel an urge to hoard it for themselves.