The salaries of airline pilots is a great example of a way to structure pay that is misaligned with performance. The hardest part of flying is takeoff and landing. So if salaries is based on the task difficulty, then short haul pilots would get paid more. But in fact it is the opposite.
I suspect that these salaries are based on the size of the plane. Long haul flights generally have bigger planes. This could make a little sense if it is based on responsibility - more people in the plane = more people relying on the pilot's skills. But if takeoff and landing are really the hard parts, then many smaller flights still has more responsibility.
Or, they are influenced by seniority. Since longer flights are easier (the plane mostly flies itself), more senior pilots get them. Basing pay on seniority is somewhat controversial. It is common in unionized organizations. It makes sense to reward employees for staying at the company, especially in industries where there is tacit knowledge that makes the employee better at his/her job. But I personally think it is better to link the salary to this tacit knowledge directly - not the predictor of job tenure.
But this is a good example of the complexity of the real world. If pay were structured based on what really motivates performance (long term and short term), seniority would have some impact, but not nearly as much as it does. Politics and other non-engineering factors still play a large role.