Do you understand the concept of group evolution? Let me explain it.
IE, say you have 3 groups of 10 people, all living together isolated from the other groups.
in the first group, all 10 are murderers. Wicked murderers. Wretches, all of them. They arn't going to get along very well, because they don't look after their own kind.
the second group, are indifferent to eachother. They meet to mate, that's all. Otherwise they ignore eachother.
The third group, cooperates and helps eachother, and works together to achieve their goals.
Now, which group, from a natural selection standpoint, would be most successful? The third group, obviously. The first group will destroy itself, the second group is no better than if they were not a group, the third group works together and the sum is greater than the parts.
So, people organize themselves into tribes, groups, governments, ideologies, etc... and natural selection acts not just on the individual but also on the tribe or government or ideology.
( when you get to larger groups, it's mostly ideologies doing the evolving, actually. IE, an ideology or moral system that works better towards social cohesion will be selected for, because the individuals in the group like it better and would rather live under that ideology than some other. )