Racism is caused because the human mind is made up of a series of generalizations.
For instance, you can only see so many frames per second, any more than that, and your mind blends the frames together to make it look different than what happened in reality. Your mind is saying: well, since I can't tell what happened between point a and point c, I'm going to rename c to b and call it good.
I mean, seriously, have you ever once had a conversation WITHOUT generalizing? Lawyers are greedy, politicians don't do anything, so on and so on. I mean, it's part of our psyche. And to be brutally honest, racism mostly comes about due to stereotypes that happen to ring true for one reason or another, when dealing with the specific time frames and societies that the stereotypes exist in.
For instance, some would say that black people are poor/dirty/stupid/criminals. It's easy to see where this stere0type came about, because for the past 100 years African Americans have been on the bottom rung of American society. Thus, of course they're going to be poor, perceivably (which is not, but should be, a word) unintelligent, dirty, and more likely to commit criminal acts.
In reality, racism is not real, because race is not real. You are, in terms of species, 100% genetically identical to anyone from any race on the planet. Even domesticated dogs have more genetic difference than a black man and a white man, or any combination of men. Race is an invention of society. Really, the difference between me, and someone from Uganda, is simply the fact that the man from Uganda is from Uganda, and his family and bloodlines have entirely different traits than mine because the same group of people kept intermarrying until the differences between them and other people got to the point where it was assumed that this man from Uganda was a different KIND of man. This is not true, he's just from a different family. And their traits have been passed back and forth in a genetic mixing pool for a couple 1,000 years, giving him mild differences in skin tone and weight and size.
It'd be the same if you seperated groups of fish and watched them for 100 years. You would not eventually develop two different species, or two distinct KINDS of fish, you'd just have some fish that developed differently because of shared genetic traits from their family members.
Racism will continue on as long as humans are alive. Our societies and our people have too short of a memory to get passed any real problems. Think about it. You've taken history, right? Compulsory history classes. Did they ever once mention Mozart? You heard about Isaac Newton in Science, you learned about Mozart in Music class, but you didn't learn it from HISTORY class (at least, you probably didn't in America). The point I'm trying to get across really is, the fact of the matter is, that information gets lost in translation through periods of time, and we find ourselves mulling over the same problems now that we did in the medieval times, we just don't know it because we don't remember because we're stupid and nobody remembers what happened back then except for people who WANT to remember.
As long as learning lessons from history is optional (unless we're talking about Christopher Columbus), no problems will ever get solved with any finality.