I find the answer to this is Childish Gambino's new song "This is America" where he outlines current racismin our country. But the real answer is that racism came from slavery. After that Jim Crow laws were enacted, where they made African Americans look really bad, like animals almost. Jim Crow was a law started in the south, which is also where they wanted to keep their slaves during the revolutionary war. They fought the North to keep slaves.
People are naturally narcissistic. they think they're better than everyone, when you're part of a weak group, you want to make yourself appear bigger and better by putting another group down. eventually people believe it.
Probably from the old days when it was found to be used as effective propaganda. Unfortunately it has carried itself on to our modern societies where it really isn't needed.