Race is a very arbitrary attribute. What it all really boils down to is being different. This difference can be skin tone, anatomical differences, cultural differences, generational differences, differences in sexual preferences, etc.
All these things go by different names, often ending in "ism", but they are all part of the same thing and spawn from the same way of thinking, and there are any number of rationales to justify them (some more reasonable than others).