There are a lot of jobs that can only be completed with significant training, but don’t involve much critical thinking once the skill is learned—machine operators and office clerks, for examples. And in rich countries, they are on the cusp of becoming endangered.

Thanks primarily to automation, and to a lesser extent globalization, no rich country’s middle-skilled workers are safe.

A recently released report from the Organisation for Economic Co-operation and Development (OECD), a Paris-based economic forum for rich nations, found that across OECD-member countries, the share of workers in middle-skill jobs fell from 49% in 1995 to under 40% in 2015.

The decline of the middle-skill job is not necessarily bad news. About 80% of those lost middle-skill jobs have been replaced by high-skill jobs, like managers and scientists. (The OECD characterizes high-skill jobs as involving “complex cognitive tasks” that are not frequently repeated.) This trend has been great for young people who attended university, but hard on older workers who held middle skill jobs that don’t want to go back to school. One industry where middle-skill jobs were almost entirely replaced by high-skill ones is financial services. Clerical workers in those industries have been replaced by software, with more resources going toward workers with technical skills.

The other 20% of the lost middle-skill jobs have been replaced by low-skill positions, such as retail clerks and house cleaners. These kinds of jobs require less training—they typically involve basic manual or cognitive tasks that can be quickly taught—but the tasks are frequently based on hand-eye coordination and are therefore harder to automate.

Next to automation, the OECD finds that globalization is a much smaller cause of the middle-skill job decline. Primarily, its effect is a result of companies offshoring middle-skill parts manufacturing, particularly to China. The OECD analysis suggests the impact of globalization is relatively small because countries that are more integrated in the global economy only show slightly larger losses in middle-skill jobs.

No wealthy county has been immune from the change. In all 23 of the OECD member countries that were part of the analysis, the share of middle-skills job dropped by at least 2 percentage points. In Austria, Ireland, and Switzerland, the share dropped by more than 15 percentage points. In these countries, the replacement jobs were almost all high-skill. Greece and Japan were the only countries where the majority of middle-skill jobs were replaced by low-skill ones.