1.) Giving big raises to existing employees often causes morale problems with their coworkers. People talk, and they get resentful if someone who (in their view) is working no harder than them is suddenly getting paid $20-30K more. So giving a big raise to one person usually means you have to give it to all of them. There are mitigating circumstances if you can point to some external circumstance that's changed (eg. "Alice got her MBA", "Bob just led this big project that made us $10M", "Cindy got promoted"), which is why companies are more likely to give raises under these circumstances. By contrast, a new employee doesn't have the gossip networks of existing employees, and the business can often invent a reason why they're being paid more (eg. "David brings special skills that are crucial for us right now", "Erin was hired in at a higher level based on her experience at XYZ Corp.")
2.) Usually the company that hires away an employee for much more money has very different profit margins and revenue growth than the one they were hired from, and so they can afford to pay more. This is the economy functioning as normal: employees should jump from companies that are less productive and less profitable to those that are more productive and more profitable, because their labor will net both them and the company more.
3.) There's a cognitive bias known as anchoring, where people form a mental model of how much a person/security/job/product should be worth, and refuse to update that mental model in the face of gradually changing facts. So if you get hired in as a junior dev fresh out of college at $60K/year, your boss's mental model of you will be "that college kid we're paying $60K/year". But after a couple of years of experience, you will be way more valuable to everyone else in the market than the new college kids coming out now, and your salary will reflect that on the open market - but your boss will still think of you as "that college kid we hired for $60K/year".
The factors feed into each other, eg. anchoring is also why companies don't adopt new production techniques and go into new emerging markets that generate higher productivity per #2, higher productivity generates a qualitative difference per #1 that justifies higher wages, anchoring is the reason why bosses & coworkers are blind to minor or gradual differences in productivity per #1, and social customs of the employees often reinforce old production techniques and prevent them from benefitting from #2.
It may be helpful to think of the rational state of the workforce as always requiring retraining, the rational state of business relationships as always hit-or-miss, and the rational state of the job market as always requiring turnover. And then individual companies create bubbles within them to satisfy human needs for security & stability, because our emotions evolved when the pace of change was significantly slower. Because most people have a bias toward stability, it creates economic opportunities for those who rationally choose instability and throw away their old relationships for more productivity and higher profits.