"If you want to increase your compensation over time, continue to put yourself in a position where you can deliver the most value."
This assumes an efficient market. In the real world, however, value of a software engineer's output is really difficult to measure. Indirect value (like helping a team member) is even more difficult to measure than direct value (like implementing features or solving bugs and so on).