Xenophobia as a primordial instinct, arose with the appearance of living beings on Earth as a natural response to the threat posed by other species, and even members of the same species who belonged to external groups. We have all witnessed a child between the ages of 1-3 start to cry when they are approached by a stranger.
The phenomena of racism, nationalism and patriotism exist among humans as a result of the kind of xenophobia that existed when primitive humans, gregarious by nature, could only survive and preserve their gene with members of their own tribe existing on the same habitat, considered the homeland. Exactly the same phenomenon can be observed in the animal kingdom only then we use different terms to describe it. This same behaviour can be clearly observed in a pack of wolves for example, who will fight other wolf packs as ferociously as other species of animal such as bear.
Unlike xenophobia, neither racism, nationalism nor patriotism can be said to be biologically inherent in human beings. Take children's pre-school groups for example. Children of different races will play together without it ever occurring to them that they are in some way different from their play-pals. All racial prejudices are adopted from by the child from their parents as they get older, who in turn adopted the prejudices from their own parents etc, going back to the era of race wars.
Aside from ethnic racism, other forms of discrimination exist in the world against religion, gender and class. Why do these forms of discrimination continue to existence in modern society?
The answer is simple - apartheid. Wherever schools exist in which children are separated into groups on account of race, religion, sex or class, discrimination in all its forms will continue to exist. The adoption of desegregation laws in the USA more than half a century ago, represented a significant step forward in achieving the eradication of ethnic racism in America.
On the territory of the former Soviet Union, class racism proclaimed by Marxism-Leninism that asserted the superiority of the proletarian class, receded into oblivion together with the Communist regime that fostered the ideology.
Whereas racism born of xenophobia is condemned throughout the world and nationalism disapproved of, patriotism is universally encouraged. Yet even this tendency is changing. In united Europe attempts are clearly being made to foster in children a feeling of pan-European patriotism in place of an ethnic, state-based patriotism.
There is every reason to suppose that the consequences of xenophobia will be mitigated by examples of rapprochement between nations and increasing globalisation as all these developments are accompanied by an increase in global level of freedom of choice. And yet, it is still very early days.