One of the biggest concerns in recent decades has been the “hollowing out” of middle-wage, middle-skilled jobs. Employment at the low and high ends of the income scale has risen faster, and many jobs that have traditionally supported the middle class have suffered by comparison, with ramifications that are social and political as well as economic.

But there’s good news: This shift may not be permanent.

To understand a big part of the reason, let’s look at how the labor market has evolved along with technology. Advances in computing beginning in, say, the early 1980s put technology in competition with workers whose jobs require following a series of discrete steps with precision and accuracy.

Working on a manufacturing assembly line requires doing the same task with precision repeatedly – say, putting hubcaps on cars. A bank teller handles cash-withdrawal requests accurately by following the same identical procedure for each customer. An administrative assistant has a list of steps to follow when organizing a meeting for multiple people, or taking dictation. And simple bookkeeping calculations require the same type of precise execution.

The economist William Nordhaus estimates that it is at least 1.7 trillion times cheaper to use computers for such step-by-step procedures than to perform them manually. And as the cost of computing dropped, robots replaced manufacturing workers on assembly lines, ATMs replaced bank tellers and software replaced administrative assistants and bookkeepers.

The occupations affected don’t include many of the lowest-skilled, least-paid people in the workforce. For example, custodians are hard to replace because it’s hard to make a list of steps that would allow a robot to distinguish between a pile of papers on a messy office floor that should not be thrown away and a pile of trash that should. Likewise, the adaptability and personal-interaction skills required in food preparation and service jobs are hard to automate because it’s a challenge to write down with precise detail the steps that would accomplish those tasks.

The highest-skilled, highest-paid occupations were at a much smaller risk of being replaced by technology, as well. It’s difficult to detail a step-by-step process for exercising good managerial judgment, arguing persuasively, thinking creatively or adapting to situations.

Economists David Autor and David Dorn document that between 1980 and 2005, the share of overall employment in low-skilled services occupations grew by 30 percent. The share in high-skilled occupations – in management, finance and other professions – grew by a similar amount.

At the same time, employment in production and craft occupations fell by 38 percent; the drop for machine operators and assemblers was 54 percent.

These statistics show that fears about a shrinking middle class and, perhaps more significantly, diminished opportunities for entering the middle class have a solid grounding, even if the populism-fueled reactions to them have been unhelpful and unproductive.

Now recent research by economist Harry Holzer suggests some reason for optimism. Holzer distinguishes between “old middle” and “new middle” occupations, the latter of which consist of health care workers, technicians, lower-paid managers and higher-paid service-sector employees.

The new middle-skilled workers include phlebotomists, X-ray technicians, paralegals, protective-services workers, chefs and retail and restaurant managers. Holzer points out that unlike the “old middle,” these jobs require a little more training and experience, and are heavier on technical, administrative and communications skills.

Holzer studied the period between 2000 and 2013, and found that across all middle-wage occupations, employment fell sharply, from 39.1 percent to 36.6 percent of total employment. Then Holzer looked deeper into the numbers: While he found a 14 percent decrease in the “old middle,” employment in “new middle” occupations actually increased by 5 percent.

The new middle is growing while the old middle is shrinking. This is a contemporary manifestation of an old lesson: A market economy is dynamic. The public debate today is quite adept at focusing on the negative effects of dynamism. But economic change creates new opportunities as well. That is precisely what we are seeing today.

Instead of bemoaning the demise of the middle class, we should be ensuring that workers can flourish in the new occupations. This will involve new models of schooling and training, including work-based learning.

The middle class has taken a hit. But its diminishment is neither inevitable nor permanent. And remember the broader lesson: Economic dynamism is much more a blessing than a curse.