Immigration is the first-to-handle, easy-fix variable when economic problems occur. Seen not only as an SES liability factor, people find it to be a symbol of their decline, so in a xenophobic hygienic attempt, people treat it as a tumor that quickly needs extracting. People's generosity often doesn't stand the test of stress. People revert to tribalistic thinking when resources seem scarce, shifting discourse to "If Us versus Them, then Us over Them."
A worthwhile element is how refugees bring customs, a way of life, and values that shift local culture ever so slightly. Whatever positives come with this, be it cultural adaptation, demographic durability, or new economic avenues for a more dynamic cultural charge for the enjoyment of all, often get overshadowed by heterogeneous pressure-induced problems. Concerns over losing grip on their ways that carry a strong thread of continuity that they feel a sense of ownership and perceived control over that they identify with becomes a social issue that gains its own life.
Immigration is a multi-faceted, double-edged sword, with its (e)valuation context-dependent. Yet the phenomenon is inevitably necessary when the population decline is imploding the economy and institutions. Having cake and eating it too mentality gets them nowhere.