I'll add that if you can't easily afford a family house next to your office, you're not overpaid.
Some time ago I used to work in a large organization on the very bottom of the food chain. I was making, say, $100k a year, which was quite decent money. Sitting there, doing same thing I could've grown to a "senior bottom of the food chain" of $150k. That was the limit. A soft one, but still the limit.
The organization was quite picky in selecting their workforce. Think FAANG. So in every team you have a bunch of quite smart opinionated folks, who somehow have to be steered in the same direction. With that I see it kinda reasonable for the team lead to make at least $200k a year. Give or take.
Now we move one step up. Someone has to pull all these "creme de la creme" cats together and herd them, so that at the very minimum teams don't work against each other. Ideally work together for some common goal. And I can understand team leads who is not willing to go to this snake pit for 30% salary increase. Why would they? 50% - may be. 70% - that sounds interesting and worth consideration.
Bottom line: according to my humble experience in "the organization", the salary roughly doubles each time you get up the ladder. And being on different steps of this ladder I can understand why.
Can a family of 4 purchase a home within walking distance of the office? Is the CEO of the company making 1000X more than those at the bottom? How much equity do the execs have and how much is it worth?
Devs are very underpaid, it's just so much value is captured by those at the top that we're all used to fighting for the scraps that happen to fall off the real dinner table.