Humans are not instinctive animals though. The key part of our evolution was the ability to reason and be self-aware. We may have once been roaming, violent, tribes of at most 100 people but this doesn't differentiate us from many other animals. That we were able to form large collectives, societies and finally entire empires and civilisations was because of our ability to think and communicate with each other and to form common stories or concepts which bind us (nations/religions etc). We have moral codes and laws which are also not an innate part of existence. This isn't abnormal or superficial, it's core to our species. It is simply wrong to assert humans are nothing more than cavemen with a level of artifice on top. The last 6,000 years didn't happen by accident.
In fact you could argue that it was the ability to think up stories, nations, religions(*) and more which was led to racism, xenophobia and anti-Semitism. It's a corruption of our ability to form cohesive societies.
Despite people claiming otherwise we do not have a great understanding of early human history. You can use dubious evolutionary reasons for this stuff but there isn't a great deal of evidence to support it. We know humans killed each other but we don't know if it was because of 'differences'. It is unlikely tribes came across much variation in their lifetimes. Scientists are increasingly
believing that racism is a learned behaviour and not a instinctive one. If you look around the animal kingdom there isn't evidence that it exists in other species....
*from the perspective of an atheist anyway