You're correct but the difficulty is finding an alternative. Training employees who are then free to take their skills to another company that didn't bother with training gives that company the ability to lure workers away with higher salaries. There is a bit of tragedy of the commons in the skilled labor pool.
Q: What happens if we provide education and training to our employees and they leave?
A: Well, what happens if we don't, and they stay?
Growing a company's knowledge and skill base is an investment, not charity. Companies that don't do it reap exactly what they sow -- they're the same companies whose CEOs will otherwise loudly complain about how difficult it is to find skilled employees, especially at a senior level, and decry the terrible state of universities. As if everyone else just stumbles upon people with twenty years of experience in a particular niche on the street.
Yes, some people will leave. The smart thing to do is to convince as many of them to stay and to stay on good terms with those who leave. Keeping a loyal employee base whose knowledge and skills remain largely unchanged after joining the company doesn't provide any kind of meaningful growth.
HR loves to trot out this saying, attributing it to the enlightened CEO or such. In my experience it's about 50-50 if someone stays because we offer advanced training or leverages their new skills to get a new job.
Well it's also a pool, meaning it rotates, you get some, lose some, get some, lose some, etc. Maybe a dev will take 2-3 jobs to learn the trade (PHP here, Js there, some fundamental web stuff to top it off, and here's your "professional-grade developer". Great.) But you get to hire equivalent devs at each step, then it's just about $/skill.
Now, if all companies made it part of their "offer" to train people "enough" (say, 1d/w), then you'd expect all the workforce to become more qualified, better in time and in age.
You could actually pay/recover the "investment" of training the equivalent of university/grad/postgrad/etc for all employees simply by the fact that everyone else would do it too (and it would certainly lower wages a bit for the early years of these newcomers, since they'd skip the idling 20's decade of many youths currently).
I don't know, it's clearly not something you could do overnight or even over a generation, it's likely to be deeper and more 'revolutionary' than that in people's minds; but mathematically, economically, it tends to make sense (we've done that for years with "guilds" and "companions" in the medieval ages and actually since forever in some trades).
I think the current mainstream / massive education (take hundreds, thousands, and grad them each year) is just the result / need of industrialization (requiring an educated workforce), a novelty of the late 19th and 20th century.
I think the cursor is moving and the explosion of alternative means and times/ages of learning is a strong indicator of that.
One approach that reduces the tragedy of the commons:
Some places require spending a certain percentage of payroll on training by law, failing which the employer must pay the difference to a government training fund. I live in the Canadian province of Quebec which is such a place. I think at least one major tech city in the US has a similar law, though I'm not sure.