Fun fact: People believe that racism has always existed; however the concept of a racial hierarchy (i.e. "racism") was created by the British. Humanity had all sorts of hierarchies before (cultural, ethnic, class etc.) but the concept that race has a hierarchy is a British invention, which was then exported all over the world, by British imperialism.
The reason why the British invented the first racial hierarchy is merely incidental. British slaver ships started taking slaves exclusively from West Africa because their access to other parts of the world was blocked by stronger empires. Over time, they started to believe that 'white' people are supposed to be masters and 'black' people slaves, because they only ever saw black slaves on their ships. Even though hundreds of miles to the East, 'white' people were being taken into slavery by non-'white' people.
Eventually, this idea of a racial hierarchy began to dominate British-elite society, as a convenient justification of slavery, on which their economy depended. By that point, the British Empire had become global, so this concept was naturally implanted all over the world. It even influenced other competing empires, like the Germans and the Japanese, who created their own racial hierarchies to compete e.g. When the British/Americans told Japan they couldn't join the League of Nations because they weren't at the top of the 'white' racial hierarchy, the Japanese decided to create their own racial hierarchy which conveniently placed themselves at the top.
This history of racism isn't taught in any school. It's a bit awkward to tell kids that people like Winston Churchill were actually more racist than the KKK and neo-nazis today, since Churchill's version of racism meant enforcing imperial racism, not simply keeping the homeland 'white.'
p.s. All human skin is actually different shades/pigmentation of brown.