In the past, animal behaviourists believed that animals lacked moral understanding. Animal relationships were considered and interpreted according to the influence of sex, age, kinship, and dominance.
They typically suggested that the most dominant gets to do what they like. Babies too get a pass, especially if their mum or dad is dominant. Also, animals are happier to share in times of abundance.
Those who thought there was more to it were deemed to be anthropomorphising. This has changed.
One icon of the shift was the publication in 1982 of Chimpanzee Politics by Frans de Waal. His detailing the ins and outs of power struggles in a group of captive chimpanzees in Arnhem Zoo in the Netherlands showed that apes understand fairness, equity, dishonesty, and other moral concepts just as well as we do.
Since then, scientists have set up hundreds of tests with many species. The results have been varied.
Animal lovers won't be shocked that in 2018, researchers at University of Portsmouth, England, found that dogs refused to participate in tests when their dog friends were rewarded and they were not.
However, it may be a surprise that in 2015 a series of tests run by a team at Heinrich-Heine University of Dusseldorf, Germany, showed that rats in a maze will take the path that helps a friend share a reward even if it means they themselves get less.
The body of literature is growing every day. For overviews of moral values in animals, kick off with Frans de Waal's Ted Talk, moral behaviour in animals, and google up the paper, Wild Justice: Honor And Fairness Among Beasts At Play by Marc Bekoff and Jessica Pierce, scientists at University of Colorado, the United States.
It's eye-opening stuff!