In Germany this isn't a legal move. One of my former employees (global telco everyone knows) tried to do the same, namely moving the contracts of the employees to an other company. 200 of them started a class action and won easily. The company had to terminate their contracts (which means the employees are eligible for unemployment benefits, etc.) and had to pay a good severance. Something like (years of employment)…
Why is it illegal to fire people in Germany?
Therefore you cannot just fire 200 people to hire another 200 cheaper, because that's a way to increase only company's profit but not society benefit. And if you fire them, you need to compensate them properly. Of course companies try to go around these regulations, it's up to each Government how to enforce laws to prevent it.