All human beings have a tendency to prefer being with people like themselves, and this can be stirred up by economic,political and social influences. It often also takes a charismatic leader to whip people up. However, many nationalist movements start during times of economic hardship. When people are scared about their economic security or their losing their traditional way of life and there are people who assume leadership by scapegoating another group then it can be relatively easy to get the people to point their collective fingers at the other group. It is easy to "blame" somebody else for your troubles, and doing this in a whole country then become nationalism.