Now suppose the best pay is doing X, and you don't like doing X at all. You're going to work doing X for 40 years? In my view a higher pay doesn't compensate doing work you hate for that long.
On the other hand, if you do work that you really like, it's relatively easy to keep it up for 40 years. Also, as it has your interest, you may become really good at it, which could lead to higher pay as well eventually.