Consequences, and you'll note that the consequences are often defined in relative terms, such as, it's okay to thump a guy from another tribe or clan and take his stuff, but it's not okay to do it to members of your own, you'll be punished for that by other members, which it occurs to me is a pretty fair summary of human civilization. It's perfectly clear from the OT, for instance, that the injunction, "Thou shalt not kill" delivered to the Israelites applied only to other Israelites. After receiving it they went on a long campaign of invasion and slaughter abetted by their mass murdering, ethnic cleansing deity.
We evolved as social animals so rules for getting along with each other in groups, with all our competing individual needs, wants, and interests, had to evolve along with us or we wouldn't have survived this long, but we still distinguish different rules for the in group, our own tribe, clan, religion, colour, whatever, and out groups, everybody who's of a different tribe, clan, etc. I think it's a measure of improving civilization that the in groups are getting bigger, they're multinational now, but there are still too many competing camps. One is all we need, and in the long term I think all we can afford.