I suppose it could be both learned and biological. Biological in our fear things that are unlike us, learned in our usage of slang and avoidance of people who we may never have avoided before.

You dont have to be told as a child to accept the black kid, you just do and dont even notice the difference. But you do need to be told to lynch them for being a different colour in order to do it. Many children grow up not even noticing the difference in other children, but if you grow up around people who are the same as you then you would be apprehensive of people who are different, the more you have been stressed by things that are different the more likely you are to have a negative reaction to new things.