Give a kid a cookie and her friend a carrot—and you'll likely hear some complaining. But this concept of inequity is a trait researcher long thought unique to humans.

Related Content Dogs and Humans Didn’t Become Best Friends Overnight

But in 2003, scientists found that capuchin monkeys could recognize such inequity, and just five years later they found that domesticated dogs could, too. Now, as Matt McGrath at the BBC reports, a new study suggests that wolves also exhibit this ability—and that it’s unlikely it's a byproduct of domestication.

For the study, published in the journal Current Biology, researchers at the Wolf Science Center in Vienna, Austria tested nine wolves and ten dogs to study their similarities. Before the study began, all animals were trained to push a button. Then they were tested two different ways.

In the first test, two of the animals were placed in adjacent enclosures that each contained a button. When commanded, the dogs would press the button with their paw. The test subject would not receive a treat, while the partner dog would receive something tasty. In the second test, each dog got a treat, but the test subject got dry kibble while its partner received a delicious bit of meat. In both experiments the animal on the losing end stopped cooperating when it realized its partner was getting a better deal. But when alone, the animals would continue pressing the button even if the treat they got was subpar.

“This showed that the fact that they themselves had not received a reward was not the only reason why they stopped to cooperate with the trainer,” says co-author Jennifer Essler. “They refuse to cooperate because the other one got something, but they themselves did not.”

As Sara Chodosh at Popular Science reports, it took the dogs a little bit longer to stop responding than the wolves, which is possibly linked to domestication and the ingrained need to please. Wolves, however, weren’t shy about walking away when they perceived things as being unfair.

“For some of them it was a really, really quick and strong response,” Essler tells McGrath. “One of the wolves stopped working after the third trial of not receiving anything while his partner received something. I think he was so frustrated he even broke the apparatus.”

The experiment had longer terms effects as well. Higher status dogs and wolves reacted more strongly and more quickly to not receiving treats or receiving unsatisfactory treats, suggesting that inequity is related to strong hierarchies in wolf and dog packs.

After the tests, the dogs and wolves both shunned their furry partners in the experiment, and wolves even held a grudge against the humans involved in the tests, remaining aloof from their trainers. Dogs, however, didn’t hold a grudge against the people.

As Chodosh reports, the experiment suggests wolves and dogs likely inherited this sense of inequity from a common ancestor, since independently evolving the trait is unlikely. This runs counter to the common belief that domestication created or amplified the trait, as many researchers believe.

In fact, domestication may have weakened some of the mutualistic instincts in dogs that wolves retain. As Virginia Morell reported for Science in 2014, when a group of wolves was given a bowl of food, all of the animals shared the resource no matter their status. With dogs, however, the highest status pup hogged the whole thing.

Both experiments suggest that domestication may have actually made them less cooperative and more sensitive to hierarchy and status—with humans sitting on the top of the pack. “It’s not about having a common goal,” Friederike Range, co-author of both studies tells Morell. “It’s about being with us, but without conflict. We tell them something, and they obey.”