When I was working at Microsoft, after about 6 years I was well over $200k a year (before cash bonuses).
About 3/4 of that was salary. The rest was primarily rolling stock grants vesting. Most of them were a grant of X shares over 5 years (IIRC). I got one grant every year and two in a couple of them (gold star bonuses). Once you have enough of those grants rolling in and they get larger as you continue to "level up," they account for a larger and larger portion of your compensation.
These types of packages are what are known as golden handcuffs. When I quit, I left over $350k in ungranted stock shares on the table.
I really enjoyed the work. I had to make a location change for family reasons, and though they offered it (and I tried it), remote work is not Microsoft's forte.
As for advice, when young: learn. Avoid jobs at either big non-software companies or startups where you (at 20-something) are the most senior software person. At 30, make sure you have been networking well, as the vast majority of senior hires into good positions are done through networking your way to a hiring manager who then sets up the interview. Especially if you are making a field change, as the filtering process for hiring experienced people can be brutal.
- "Avoid jobs at either big non-software companies" - As cool as it may sound to design websites for the NBA, or design systems to help market movies, neither will teach deep technical skills. You'll outgrow your mentors quickly.
- "The vast majority of senior hires into good positions are done through networking your way to a hiring manager who then sets up the interview" If you don't know people once you hit your 30s, people will wonder what's wrong with you. Why can't someone vouch for you? It's a form or ageism, and it may be morally wrong, but be aware that that's what you're up against. It's even more true at 40 or 50. This means networking with your customers, being kind to your suppliers, knowing who your competitors are, and making acquaintance with folks who could be one or two degrees away.