You're so right! Our morality and values are thought to be caused by the progression of our social intellect as we evolved. Our ancestors lived a lot like modern chimpanzees do; social groups within territories, with neighbouring (and potentially rival) groups nearby. They would have had to cooperate with each other in order to locate and defend food sources, and to warn each other if they saw a stranger in their territory. They would have learned to recognize if a stranger was a threat or not, and that requires being able to judge character. To understand another person's intentions or feelings to that degree you need a lot of empathy and intelligence compared to other animals.  Part of cooperating in a group requires sharing; like ensuring that you will have a meal next season if your friend shows you a new fig tree, by gaining their trust by first sharing the termite mound you'd found with them. We developed the capability to trust and deal. Studies have shown apes and monkeys reacting with anger if they are given a bad deal, it's kind of adorable. We also   618  learned shame when we were rejected by our group members. We could be rejected if we stole from or hurt another group member, because it disrupts the system of trust. We are eager to be recognized as an important part of our group. As our social way of life became more and more important to our survival as a species, these abilities were selected for as most successful. So successful that our intelligence and ability to build societies propelled our evolutionary lineage into what it is today. It's gone a bit out of control at the moment, but I prefer not to think about that. (Pretentious-sounding but sincere and awkward disclaimer: This comment is based on some of my university-gained knowledge, so it's all sourced and peer-reviewed information but potentially out of date. I haven't researched the subject lately, so there could be new studies to consider. Idk if anyone cares that much tho.)