It's because they are unable to tell who is worth what. So they outsource it to the market. If you managed to pass the interviews and get hired at the other big tech company, that's proof of value.
It's also self-reinforcing. If you don't leave, it's a signal that you don't trust your own market value to be higher.
For every dev that is able to make the "Microsoft -> Google -> Amazon -> Microsoft" circuit, you have n others who look hardly distinguishable to management who can't do that if they tried quitting. In other words, quitting is risky, in game theoretic terms it's a costly signal of competence.
I also wouldn't be surprised if it had some internal politics reasons that there are certain rules/power games around salary raises that don't apply when someone is hired from scratch.
Regarding this:
> It's because they are unable to tell who is worth what. So they outsource it to the market. If you managed to pass the interviews and get hired at the other big tech company, that's proof of value.
They still hire people who do not come from other big tech, though, so there is a process in place that at least claims to tell who is worth what.
The other problem is that the filter is in practice not for competence but for tolerance of risk.
This is different than what GP asked, it excludes anyone who might prefer stability over fast raises. Are the job-hoppers the majority, or are they just more visible because they're always interviewing?
That said, I don't think one can blame the devs for it, since it is the companies themselves that have created the environment where the above holds true. I never understood why - intuitively, it doesn't make sense for the company to underpay its devs to the point where they leave for a competitor, and then come back and get rehired at a much higher salary anyway. But it is what it is, and the workforce has caught on.