The concept of race is actually a manifestation of a very old and fundamental human process, that of ingroup and outgroup identification. It developed for a single purpose, to facilitate harm against the outgroup, in this case the race in question. But hatred doesn’t come out of nowhere, their needs to be a reason, even if it is not a valid one. People wouldn’t bring such energy to bear against a target they thought didn’t matter, so the best remaining emotion to draw on is fear. All prejudice stems from fear. We even recognize this in terms like homophobic. Without fear, hate has no basis. Fear is based in the belief that a harm will come, and is built around taking action against it. This plays in to the nature of prejudice. The hatred of prejudice is designed to keep a group from gathering any power, and showing them that they are not welcome. Without the certainty that the group could cause trouble, there would be no reason to pay them any mind. Therefore, the concept of race must convince its believers that members of the other group is dangerous in order to get them to take action. This is why you see claims like the Mexicans are taking our jobs. To add an ironic twist, since the current concept of race developed during the colonial period, its likely that it developed out of a fear that what the colonizers were doing was wrong. To counter this fear they developed excuses that made it easier for them to do what they did.