I just saved $500K per annum for a customer, after working on the most critical part of a merger between two 10K-user organisations, and I get less then half that.
It's not like it's impossible to get someone that knows how to optimise infrastructure or do complex projects for less than a decent chunk of a million dollars a year! Like other people have commented, they're often making just tens of thousands in Europe, despite having comparable education, experience, and English language skills...
If $$ is what you optimize for, you can probably find the top 1% of compensation for businesses in your field and work there. For a lot of office workers, there are firms that value their skills and firms that do not. Remember that the comp numbers for Bay Area tech salaries are legit the top 1% globally or some very small percentage.
Consider the difference between an comp "analyst" at a local bank and an "analyst" at an extremely profitable hedge fund.
It's just money in the end and if you make enough to be happy, then the rest doesn't matter. If you want to compete for the top < 10% of compensation locally/globally in your field, then things have to change and it comes at some cost.
But at the scale they operate at, it is also relatively easy to justify such salaries. For example, just last month, I saved the company more than a million a year of cloud costs by doing 1 week of cost optimizations for just one of our services. I will create many times that in new revenues/cost savings in the remaining 2 months of the year.
My total comp for year? Barely over half a million. So I'd say they are getting a good value.