@Ritsuaka Originally? They didn't. The racism started after Africa began the slave trade with the Europeans, selling off the losers of wars they waged with other African States. After that it just became a natural thing to look down on Africans because they were literally spoils of war, which was ironic because even the victors of the wars in Africa wouldn't recognize the losers as Africans. Some Africans even started wars explicitly for selling off the losers and they made a big living off of doing that. From there it was just as it usually goes when dealing with a second class, looking down on them, false facts, restricting education etc.
The narrative that white people just saw Africa and Africans and decided to start throwing nets is false. A majority of the slaves brought to America were sold off by their own nation.