Supply and demand.
Not enough people in a special job? That job becomes more valuable, they pay more for that service. Suddenly, people want to work that job to make more money.
Too many people working some kind of job? That job becomes less profitable to work. It is easy to find workers so employers will pay less for that job.
This creates balance. When there is demand, people will fill the supply. It is not always perfect, but ultimately it is enough.
Labor market… if we need more workers in a field than we have, pay goes up to draw people to those jobs. Could be an immediate thing, like how fast food restaurants have recently had to raise pay to hire enough workers, or it could be something like doctors where we pay high pay given the importance of the job, and to incentivize people to spend so much time going through college, medical school, residencies to train as a doctor.
Latest Answers