There's a vein of truth here, but it's a bit navel-gazing.
The first truth is that people don't leave their current jobs because someone else is offering more. They leave because they're unhappy. For knowledge workers of all stripes, unhappiness is very, very rarely about compensation.
The second truth is that high compensation keeps people where they are. If a recruiter is offering $200k, you'll listen if you're making $180k. You won't listen if you're making $250k. If you're making $180k, the $20k bump becomes a socially acceptable reason to tell your employer you're leaving, but it's not the true reason you're leaving, because every time you switch jobs, you run the risk of bad management, mistreatment, etc. There's a price to taking that risk and it's not usually worth small bumps to people. When you post a salary band, 90% of the time, people who respond are not looking for the pay bump, they're just considering you before the 90+% of employers who are not posting pay bands or whose pay band is uncompetitive. And they know that they're that much more likely to stay because it'll be that much more difficult to persuade them to leave after they join.
The third, deeper, more cynical truth is that posting salary bands probably signals to employees internally that they are being underpaid, and can provoke discontent and departures. Rather than fix the problem with a long-term solution of unilaterally issuing raises internally before posting salary bands, most companies take the shortcut and keep the salary band private.