And then there are the, as you say, local attorneys doing routine real estate transactions or whatever. Which tend to be pretty middling compensation generally.
The story isn't quite that neat of course. Big company in-house counsels tend to be reasonably well compensated professional jobs and there are successful owners/partners of local law practices but there's a pretty good bimodal narrative in general.
You can imagine why there might be a modality for people who can land jobs at specific tech companies that pay outsized salaries because they're so profitable and can afford to be very selective based on (they hope) relevant criteria but it's certainly based on less clear metrics if nothing else.