In Belgium, they used the "Claeys formula" for many cases:
https://en.wikipedia.org/wiki/Claeys_Formula. (I believe they use something different now, but it's hard to imagine that unions would have allowed a significant relaxation of the earlier rules, so it's still a good first order approximation.)
Some examples:
- somebody who makes 5000 euro gross per month who's 20 years with the same company would get ~15 months severance.
- somebody who makes 3000 euro gross who's 5 years at a company would get 7 months of severance.
Interestingly enough, the age of the employee is a factor of the equation!
When it's the employee who decides to leave the company, the company can require them to stay on for many months, again depending on how long the employee was with the company. Or the company can agree to release earlier, but it will still be on the hook for a significant amount of months of salary.
Let's just say that the decision to hire an engineer isn't done lightly.