The rise of nationalism and antiglobalism coincide. But what causes what? Is it the rise of nationalism that should be blamed for globalization's reversal - or the effects of globalism that explain the rise of nationalism?
I have worked upon demography of Karachi and touched upon the topic of nationalism. I findings are that when any external force attempts to negate the identity of individuals or groups then they tend to go in their shells of nationalism and announce their identity. Globalism brings people closer and eliminates their identities. According to cultural diffusion-ism when different cultures interact they assimilate and some cultures become dominant and engulf others. In our world today dominated cultures feel threatened and their fear fuels nationalism. On the other hand the developed world due to globalism is feeling the strain of immigration into their societies.
Though I absolutely agree with Dr. Moiz's answer (and like his wording quite a bit) I think that your first impulse is worth further consideration. The economic precarity that accompanies globalization is certainly very crucial as well. I would also point out that perception is a crucial consideration here, as the pure and untrammeled locale is a myth and globalization or at least multi-locale connection is not as new as the language some use to talk about it may imply. Specifically, I mean that economic situations are inherently dynamic in a market economy, but that confidence in market stability can lead to the perception that they are less precarious at a given point in time. Additionally, I would argue that what you are dealing with is also - in part - a matter of when the perception of globalization became foregrounded by people who were uncertain, nervous, or angry about what had happened to their personal, "local" life.
Just as the threat of identity dissolution compels some to retreat to nationalism, the increased awareness of economic instability is also a powerful driver to "double down" on identity and boundary maintenance work (of both the conceptual and material kind). As Dr. Moiz points out, the return flow of the globalization ( and here I mean globalization-as-project) that was imposed upon what was once called the Third World is the presence of more and more migrants from those countries in the "First World." When this accompanies an economic shift, the presence of apparent physical, ethnic, and cultural differences are easily conflated with the presence of a different economic condition, and thus scapegoating can easily occur and gain traction.
To summarize, I think that it is an powerful insight that the cultural diffusionism facilitated by globalization (or at least transnational systems/networks/circuits) will lead to a heightened perception of the threat of identity solution and will trigger greater nationalism and identity politics, but I would add that economic precarity is not an alternative but rather a complementary part of this process. At the bottom, it seems that Dr. Moiz and I both agree that the rise of nationalism results from "the effects of globalism," but I would not discount the possibility or necessity for their to be some two-way constitution of this phenomenon.
A very concise summation, Dr. Molchanov. Alternatively, in some case, it could also be that economic or lifeway disruption might be the stimulus, while the presence of a contact zone between cultural traditions (made possible through cultural diffusion and migration) simply provides the outlet for those frustrations. It would be interesting to figure out which factors matter in determining the differential directionality of causation!