Alright so first off, 150k will give you a comfortable upper middle class lifestyle in SF/SV (assuming you have no dependents, in which case it's just middle class). It's really not the astronomical salary that you seem to be imagining.
Secondly, it is completely impractical to pay people based on the "difficulty" of their work. Difficulty, even if we can agree on a definition, does not correlate with revenue. Revenue is traditionally where salaries come from.
Intuitively, if person X in a team of n people writes an app that produces profit Z, then it would make sense for person X to get something on the order of Z/n -- not 100k because it's just a chat app. This is not actually how it works because of some artificial constraints. I believe the calculation in most cases looks more like pay = 120k + 20k if in expensive city + MIN(.01 * profit, 150k).