Early in our marriage, now almost 30 years ago, my wife presented me with this question: “Why do professional baseball players, who engage in a sport that was invented for fun, earn a thousand times more than school teachers? Certainly teaching school is more important than hitting and throwing a baseball.”

My wife’s question is typical. As we look around the economy and assign some level of importance to jobs, we see that pay and importance don’t always seem to match. Jobs such as those of school teachers, policemen, firefighters, and nurses — all performing essential work that we can’t do without — are paid substantially less than professional sports players, nationally renowned entertainers and actors, and executives of big companies.

Let me take a shot at explaining this. First, recognize we don’t have a national economic dictator or governing board that sets what various jobs will be paid. Instead, we have a virtual economic “free for all” in which workers and businesses are free to negotiate, accept, and reject job offers and demands.

In this setting, the determination of salaries is rather simple. Salaries are set by the interaction of the demand for workers in a particular job and the supply of workers able to do that job. Jobs for which there is a high demand, but low supply, will pay the most. Jobs with a low demand, and high supply, will pay the least. The pay of other jobs will be in the middle.

I know what you’re thinking. What’s all this demand and supply business? Let me drop the economics lingo and speak in intuitive terms. Businesses want to hire people who will make a lot of money for them, and the more money, the better. Therefore, workers who can pull in big bucks for a business will be more sought after — the demand for them will be higher — than workers who can bring in only small change. The way for businesses to attract the “big bucks” workers is to offer them higher salaries.

But this is only half of the pay picture. On the other side is how many big-bucks workers there are. If they’re everywhere — the supply is large — then even though each worker is valuable to a company, companies won’t have to work hard to hire the workers, meaning salaries will be modest or low. In this case, the big supply trumps the big demand.

Yet if there are few of these valuable workers, firms will be outbidding each other to grab them, so salaries will be high. The combination of big demand and small supply generates a gigantic paycheck for the workers.

Now let’s go to the other end of the salary spectrum. Jobs that contribute relatively little to the business’s bottom line won’t carry large pay offers. However, combine this with a situation in which many people can do those jobs, and bingo, you get low demand combined with big supply, meaning a paycheck at the bottom end of the salary ladder.

So why do pro ballplayers get millions? If they’re good, they put a lot of people in the seats, they sell a lot of merchandise for the team, and they jack up advertising rates. Plus, although many of us had dreams as kids of being ballplayers, few folks can throw or hit a 90 mph fastball, make a three-pointer with a hand in the face, or rush through a defensive line of 300-pounders. So, big demand and low supply equals major league salaries for pro players.

What about teachers? The reality is that more people can teach school than have the skills to play pro sports, so the supply of teachers is greater. In addition, schools, especially public schools, don’t earn big revenues for teaching kids. The result, big supply plus modest demand, equals modest salaries.

Michael L. Walden is a William Neal Reynolds distinguished professor at North Carolina State University.