Psychology of xenophobia (under construction)
The metaphor of moral circles is a way to make sense how we make moral distinctions between different groups of living beings. This metaphor was first employed by Peter Singer in ‘The Expanding Circle: Ethics, Evolution, and Moral Progress’
In his classic study The Expanding Circle, Peter Singer argues that altruism began as a genetically based drive to protect one’s kin and community members but has developed into a consciously chosen ethic with an expanding circle of moral concern
Your moral circle would include the type of living beings that you would want to help, and that you would not hurt. Initially moral circles only included our kin and tribe, but over time they have expanded. For some, they now include all humans and non-human animals, whilst for many they include all humans who are geographically close (e.g. in the same nation state).
In my examples, more weight is given to those living beings in the smaller circles, with weight being reduced as the circles expand.
Terror Management Theory
This social psychology/existentialism theory was inspired by the writings of Ernest Becker. These were built on by Jeff Greenberg, Tom Pyszczynski, and Sheldon Solomon, to construct the theory, and provide falsifiable hypotheses. Terror Management Theory (TMT) concerns the existential crisis that arises from having a desire to live, but realizing that death is inevitable. The theory proposes, at most extreme, that all human activity is driven by fear of death. The simplest ways to quell the conflict are by making use of cultural ideas that promise immortality (e.g. religion, and more recently, life-extension). However, here we will discuss the concept of mortality salience, which is derived from TMT. This is the concept - from TMT — that the majority of empirical research has concentrated on. Mortality salience (importance of being aware of mortality) induces existential anxiety, that is thought to be buffered by an individual’s cultural worldview and/or sense of self-esteem.
This potential for [existential crisis] is managed by a cultural anxiety buffer, consisting of the cultural worldview and self-esteem. The cultural worldview is defined as a set of beliefs about the nature of reality shared by groups of individuals that provides meaning, order, permanence, stability, and the promise of literal and/or symbolic immortality to those who live up to the standards of value set by the worldview (Jones et al, 1997)
When individuals are forced to become aware of their own impending death, they will cling more tightly to their own [in-group] cultural worldview, and feel threatened by other cultures that oppose this with alternative worldviews.
Greenberg et al (1990) showed that mortality salience produces favorable attitudes towards another individual who shares one’s worldview, and more negative attitudes towards another individual who does not share one’s world view 
- Terror Management Theory and Self-Esteem: Evidence That Increased Self-Esteem Reduces Mortality Salience Effects http://www.socialemotiveneuroscience.org/pubs/hj_etal97tm.pdf
2. General and Personal Mortality Salience and Nationalistic Bias http://psp.sagepub.com/content/23/8/884.short
3. Evidence for Terror Management Theory II: The Effects of Mortality Salience on Reactions to Those Who Threaten or Bolster the Cultural Worldview https://wesfiles.wesleyan.edu/courses/PSYC-309-clwilkins/week2/Greenberg%20et%20al%201990.pdf