Why do different ethnicities/races look different? - eviltoast

I realised that for some reason, I still don’t know this. Why do we have different skin colors, hair textures, eyes or such? Is it just a random thing that happened or are there evolutionary reasons to it?