I know most Americans feel its the strong worker protections in the EU that cause the pay stagnation. It's far more complex than that. SWEs can leave for another company whenever they want. In some cases there are deep structural issues* that can keep you at a company.
* One example, in France there is no upper limit on the caution for an apartment. It can be as high as 20k-50k€. If you need to rent a place and don't come from a rich family your employer can provide the caution. Now that your employer has solved your housing problem you feel a certain loyalty to them and the 10-20 year career starts.