Of course there's a lot of people who are highly paid. Chances are that those people are highly skilled, or at least have highly specialized skills as well.
FWIW, at least at Google it isn't about specialization. Google SWEs are expected to be generalists, able to specialize as needed.
In fact, it's generally recommended that SWEs change teams within the company every few years, and that they intentionally look for a change that requires them to learn new skills. The belief in the company is that this approach serves both engineers and teams, providing fresh perspectives and insights to both, and spreading knowledge across teams (by moving it) and within teams (by reallocating responsibilities).
There are exceptions, of course. Some skills are rare enough that people stay within that field, even as they move between teams. On the other hand, even those exceptions have exceptions. I won't mention his name, but Google employs a famous cryptographer who recently decided that after many years of breaking the world's encryption systems he wanted to work on image compression. So he is. Another engineer I know has a PhD in computational mathematics, with a specialty in image processing. After a few years extracting building details (exterior shape, mostly) from merged aerial and street view photography, he now works on UI frameworks.
The choice of when or if to move to another team, and which, is the engineer's. The destination team also has a say, but most teams are perpetually short-staffed. Unless the team in need of some deep skill (e.g. a PhD in computational mathematics with specialization in image processing), or unless the engineer hasn't been performing well in the previous role, they're unlikely to refuse. This is why apparently-odd moves aren't uncommon; people decide they'd like to do something different, so they do.