I worked my ass off, grinding on interview studying, working internships and jumping companies whenever I could get a better offer. I'm about to turn 30 and I made 430k (200k of which is salary) in 2021 working at a big company in the US.
I would not consider my background to be particularly privileged and I don't consider myself to be all that smart, but I managed to get here just by working hard and never getting comfortable. Yes, if you get comfortable in the first tech job you land and just sit around enjoying your life, then you probably won't naturally end up in a place making lots of money.
Obviously being privileged and getting everything handed to you makes landing a nice cushy job much easier, but there are still plenty of paths to these high paying jobs if you're willing to work hard.
Also, as mentioned by another person in this thread, this totally does take a toll on your mental health and you absolutely have to sacrifice things. I gave up a lot of things that would have given me a better quality of life, but those were choices I was willing to make.