I think it is basic human nature for people to gravitate towards other people who are Like Them - whether it's because of race, religion, social status, common interests, whatever. We all have our tribes of one sort or another.
But how to end racism? How about, by being nice to one another. Wow, what a concept.