What a question on a PE forum of all places. As 'race' is something that changes how we feel about ourselves and each other, even when it comes to penises, perhaps here is as valid a place as anywhere else to discuss this.
Having grown up with white and non-white family and lived across many countries I've got to see and feel this shit from many perspectives.
I'm no anthropologist but from what I've seen, prejudice about where someone is from or their 'race', arises from these ways that humans have evolved to be:
Tribal
Dominating
Competitive
Genetics research has demonstrated that all people on Earth today, all these different 'races', have one common ancestor, an ancestor which we all share. We are all distant cousins from one tribe.
So the ideas of separate races arising from different parts of the world at different times was false.
We now have to leave behind the stories about being different races, because it is incorrect.
We are all one race.
If you want further insight on how and why people respond in racist ways you may want to search for the work of ethnographers.
Ethnography (from Greek ἔθνος ethnos "folk, people, nation" and γράφω grapho "I write") is the systematic study of people and cultures. It is designed to explore cultural phenomena where the researcher observes society from the point of view of the subject of the study.