To give a specific example in this case.. a type rating to fly a Gulfstream business jet is on the order of $100,000. If a pilot works for a few months and quits, the employer is out a pretty significant chunk of change.
An alternative arrangement to direct employment is that the pilot could pay for his/her own type rating, and work as a contract pilot. But that requires having $100k to plunk down, and taking the risk that the job market will be strong after the type rating.
In this case, the employee may prefer the "indentured servitude" route versus having to front 6 figures to get their own type rating.