Earlier quoted context omitted.
From the description, I would assume Germany, since that's precisely what happens here. But I can also imagine Germany is not the only state that allows its companies to act like this.
Why would workers from Eastern Europe not have passports? "Eastern European" typically means EU-member states, with Ukraine being the exception even before the war (within reasonable distance, populous enough for recruiters to go to). EU-citizens don't need a residency permit, and they have access to the social system in Germany. They're often not informed about their rights and that should be improved, but "they end…
This is with a huge asterisk. Workers (EU or otherwise) moving to Germany or any other country for that matter, have access to welfare only once they've contributed enough to the system, not right away.
Being highly vulnerable, having small kids or health issues may entitle you to some benefits right away, but welfare/unemployment benefits have a mandatory period of contributions to the system before you can claim them.
Sure, there are system savvy people, locals and immigrants alike, that have found loopholes and ways to game the system, turning welfare into a taxpayer-funded lifestyle, which is the topic of many heated political debates on the future of the socialist welfare safety system, as too many people rely on it and not enough contribute.