Just a thought from another industry, but it's not just aviation that does this. I work in embedded systems / electronics, for a company involved in consumer electronics and silicon IP - if none of this makes sense, call it 'high tech' - where qualified people are not easy to find. The standard expectation is that people will be well educated before they get to us, although we do take on fresh-out-of-training folk and build them up, so not entirely like aviation. The company is a mid-size multi-national corporate.
If the company sends us on a course, which they pay for (generally something required for us to do our jobs), you enter into an agreement with the company to reimburse them if you leave within a certain period afterwards. The exact period varies depending on the cost, and reduces over time, and you agree that the company can recover the monies from your final paycheck. This is not unusual in this industry.
Of course, the average course doesn't run much more than a few Łk, and the average monthly salary here is at least that, so there's actually some chance of the company being able to collect. It's probably a bit different when the amounts are up in the tens of thousands...