1. Earning potential is higher in management, if you can make it to a director-level or vp-level position at a major public tech company; take a look at the relevant comp figures for Facebook, Google, Microsoft, etc. on Glassdoor.
2. Being a sales rep at an enterprise software company with an aggressive comp plan is another option, if you can do the work. As @kasey_junk noted, this is because sales is compensated on a percent of revenue basis.
You might also look at technical consultancies, or try to become a technical expert for pe/vc firms.
Gaining wealth through investing your own money is hard; even at a market-beating 12% a year, it would take you more than 20 years to turn $100k into $1M. You can make money this way, but you need to manage a fund. The entry point is an analyst role at a hf/pe/vc firm.
I think @kasey_junk is 100% right; ultimately, you need to tie your work to some kind of economic value. We as humans are bad at assessing indirect value creation, so the roles that tend to achieve this tied-to-economic-value comp in practice are [1] sales, [2] investment professionals, [3] substantial equity owners.