Per engineer, Google, Facebook, Apple make multiple millions of dollars in profit per fiscal year and yet very, very few engineers make $1m+. Even $500k is out of reach of most non-managerial engineers.
So, no if Google made 2x or 4x the profit with the same engineers, they company would pay them the same exact rate if they could. Often times they do.
The only way to really gain serious income is ownership of a technology that you can sell either directly to the market or to another company.
No matter how much you make, as an employee you are always trading lower risk for lower or linear rewards. The company compensates you for your years of experience at a market rate but, retains the fullest share of the profits that they can. They also own the code of your labor after you leave the company so there's that. You work (especially as a developer) makes the company money even after you've left.
If code wasn't so complex and hard to maintain, there would be even lower salaries (compared to profits) at software-based companies.