That's taking about external migration (refugees and illegal immigrants), not internal migration under the EU's freedom of movement. Of course, the latter was a major factor in the Brexit referendum, so I wouldn't say it's not a major problem for the EU...
What's even the point of the distinction if the EU is not adequately restricting immigration from those other countries? The point remains the same: people from poor countries are mass migrating to rich countries with the most social programs. This is a major problem for the EU.
The point of distinction is that EU internal immigration and the refugee situation are entirely different things. Refugees leave there home countries because of war and terror. Members of the UN are obligated [1] to give shelter to those people.
Inside the EU there is indeed some welfare migration. This is however not only driven by social systems but also by available jobs.