The more I look at the phenomenon of racism the more I come to understand that it has an economic basis. Although I have no doubt a certain degree of xenophobia is part of the human condition, I also believe that certain elites within societies have been, and still are, quite prepared to exploit and exacerbate this low level 'fear of strangers' for their own ends. What's worse, 'strangers' are often not really strangers at all but easily identifiable groups within societies who can be isolated and demonised. A classic example is the Jews of Europe who were victimised for centuries. They tended to be, on average, economically more successful than their Christian neighbours so various Christian myths were invoked against them in order to steal their wealth. In the late 19th and early 20th centuries these myths transformed into the vile nonsense of "scientific racism" - which, of course, led to the Jews being robbed, dispossessed and murdered.
Look at any example of racism in history and it tends to have an economic basis.