The most important reason for the variation in compensation between positions and between professions is supply and demand. In a free market economy such as ours, wages, like most prices, are influenced mainly by how many people can do a given job well relative to the number of such people that is needed. A related consideration is the amount of value (measured in money) that the job adds to its organization and to society.
The main influence on compensation is supply and demand. People often talk, for example, about how horrible it is that NBA players make so much more money than teachers. However, the supply of great basketball players is much lower relative to the demand for such players. Every team in the NBA wants a superstar and there are not nearly enough truly great basketball players to have one on each team. Even the other NBA players are in high demand relative to the supply because there are simply not many players in the world good enough to play in the NBA. Meanwhile, essentially anyone who is smart enough and motivated enough to get a college degree can become a teacher. This is not to say it is easy to be a good teacher, but it is much easier than being a great basketball player. Accordingly, NBA players are paid much more than teachers.
Added to that is the fact that NBA players make value more clearly than teachers do. A great teacher’s impact may be felt only some years down the road and, even then, in very minor ways (economically speaking). By contrast, a great basketball player can make millions for his team every year. The obviousness of the value of the basketball player helps increase his salary relative to that of the teacher.