One viewpoint is that the company must do everything it can to ensure it’s staff never leave, i.e.: become prisoners.
That’s not the right viewpoint.
A company’s responsibility is to help its staff find what makes them come alive. Give them the skills and exposure to help them find the role that makes them truly happy and excel.
Even if that means they outgrow your organisation and leave. Better to have helped someone find their calling and set them free, than create a prison of unwilling workers.
Ironically, that is how you end up keeping your best staff: When they feel they’re free to go, they’re more likely to stay.
Good faith engenders loyalty.
Help people come alive.