I guess I'm lucky in having had a chance to work for several fantastic companies that treated me wonderfully for years and years.
And we also raised up juniors, and paid them well. And our company had flat salaries, so everyone could easily figure everyone else's salary (and people didn't hide it, in fact we talked about it all the time).
Again, treat your employees well, and they'll stay. Places *do* do this. And people *do* stay loyal and even come to companies because they hear how well they treat their workers.
I count myself lucky as well. I've been in a few great places. Also stuck in tolerable places for 5-10 year stretches because it's a paycheck.
Sometimes people leave (for money or variety) but come back, because they realize other places were worse (despite the money). Sometimes they don't because they're afraid or tired. It varies. But yes, people often walk away from places that either treat them badly as a company or because they have coworkers that treat them badly. The reputation tends to stick, too, even though it doesn't often spread very far.
And we also raised up juniors, and paid them well. And our company had flat salaries, so everyone could easily figure everyone else's salary (and people didn't hide it, in fact we talked about it all the time).
Again, treat your employees well, and they'll stay. Places *do* do this. And people *do* stay loyal and even come to companies because they hear how well they treat their workers.