I specifically mean EU countries by the way, Switzerland and London are the only exceptions -- and even then the US is better.
You don't. You spend those "millions" of dollars on ridiculously expensive medical care, on ridiculously expensive education, on car ownership, on... And in return you get worse infrastructure, worse medical care, worse ecology etc.
As for medical care, all half decent tech employers provide comprehensive healthcare coverage.
I don't know what you've been reading, but unless healthcare costs $200,000 a year (it doesn't cost 1/10th of that), you're better off in the US.
As for "worse infrastructure", you'll have to be specific. There's crumbling infrastructure all over the US and Europe.
Worse medical care is also a stretch. In fact, in some areas (heart attacks and strokes, for example) the US is a world leader. [1]
I'll remind you that new grads in the US are often paid substantially more than senior level developers in the EU.
[1] https://www.cnbc.com/2018/03/22/the-real-reason-medical-care...
Yeah, ain't that right. I've been programming for 20 years, worked as a lead developer/architect and have usually been among the most highly compensated technical people in companies I've worked for. And yet I have never seen anything close to the kind of money fresh grads get at FAANG.
On the other hand, if I landed a job paying 300k-400k USD a year, I'd probably just retire after 4-5 years.