> they gain domain knowledge that is specific to that company, and that stuff is incredibly valuable. The wild thing is that it’s only valuable to that one company!
From the engineer point of view, this is a bad deal as the knowledge they get is precisely not transferrable to another company. So staying is a risk (these skills won't even exist elsewhere) and there is a lost opportunity for the employee. They could be at another job, learning actually transferrable skills, thus improving their standing on the market.
Solution: minimize company-specific knowledge, make it easy to grok and not company-specific. To be a bit blunt: your flavour of pile of poo codebase isn't particularly interesting so why should I learn it if compensation doesn't match the missed opportunity?