It is mostly VC money or companies that need to pay that much to keep the best talent around (aka FAANGs). Most software engineers do not make 400k in the US. They just don't.
Nobody is claiming that most people make $400k. Take the median numbers by country from the article - $187k in US vs $108k Europe - that's still a significant difference.
Yes - location is key. I'd be surprised if people made FAANG salaries outside the west and east coast, and even then at quite specific locations / industries. Not sure what the pay is in emerging cities like Austin, etc.