WONG CHAP WING, a native of Hong Kong, runs a factory in Dongguan, an industrial city north of Shenzhen. Hip Fai, his privately held firm, stamps metal parts for things like printers and copiers. The energetic septuagenarian started dye- and mould-making in 1966, and recalls a time when migrants were grateful for a job. “There are not enough technical workers now,” he complains. Young people turn up their noses at factory work. He used to pay 600 yuan a month, but now they demand 5,000.

The future is not bright for workshops that cannot upgrade. Mr Wong looked into shifting to a cheaper location inland but decided that the savings were too small. He says that many low-end subcontractors in his area are closing down. Looking at the antiquated equipment and the throngs of workers in his factory, it seems this greasy and noisy place, too, may face extinction.

Turn a corner, though, and you spot the future: a hybrid assembly line where shiny Japanese robots are mingling with human workers. Peter Guarraia of Bain, a consultancy, explains that the big global trend in factory automation is “co-bots”: robots designed to collaborate safely with workers. They will look out for people and can be programmed by line workers.

Dongguan has an official policy of encouraging automation, part of a national strategy to upgrade manufacturing

Mr Wong spent 200,000 yuan on each robot but expects to get his money back within three years because his reconfigured assembly line is much more productive. Looking back, “I could not imagine my factory full of robots,” he reflects. “I came here for the cheap labour.”

Dongguan has an official policy of encouraging automation, and has set aside 200m yuan a year to help its factories eliminate jobs. This is part of a national strategy to upgrade manufacturing through automation. The governments of the PRD are leading the charge. Guangdong has pledged to spend 943bn yuan to boost the manufacture and adoption of robotics in the province. Guangzhou optimistically hopes to automate the jobs of four-fifths of the city’s industrial workforce by 2020.

The productivity imperative

The sprawling headquarters of Midea in Foshan, a city near Guangzhou, look as though that day has already come. The firm was started in 1968 with 5,000 yuan, operating from a workshop measuring just 20 square metres. He Xiangjian, the founder, and his team scrounged what they could from Mao’s tattered economy to make plastic bottle caps, glass bottles and rubber balls. Today Midea is a Fortune 500 company and one of the world’s biggest white-goods manufacturers, selling everything from internet-controlled kitchen appliances to smart washing machines. Mr He, who retains a controlling stake in the firm, is a multi-billionaire. Last year Midea gobbled up Kuka, a German robotics firm, in a deal worth nearly $5bn. It also has a joint venture with Yaskawa, a Japanese robotics outfit. It is spending 10bn yuan to develop robots, both to use in its own factories and to sell to others.

There are two main reasons to think the delta’s factories need to upgrade. First, the level of automation in China remains low compared with some of its competitors. In 2015 the average for the country as a whole was fewer than 50 robots per 10,000 factory workers, compared with about 300 in Germany and Japan and more than 500 in South Korea (see chart).

Second, China’s supply of cheap labour is running out, which is pushing up wages steeply. China’s low birth rate, exacerbated by its one-child policy (now revoked), has meant that the working-age population has already peaked and is set to shrink significantly in the next few decades. The mass migration of poor rural dwellers from interior provinces to the PRD is slowing, and without that influx of labour, growth targets will be harder to hit.

As a consequence, China urgently needs to beef up its productivity. Over the two decades to 2016, labour productivity has risen by an average of 8.5% a year, but in the past three years this growth has slowed to less than 7% a year, and the absolute level remains low, at only 15-30% of that in OECD countries.

Yet automation should be market-driven, not subsidy-induced, and there are signs of a bubble. Thanks to the official push for “indigenous innovation”, Chinese automation firms are often subsidised even if their technology is not up to scratch.

In an era of rapid growth and cheap labour, Chinese bosses set up factories without much concern for efficiency or quality of tooling. If a problem arose, they would throw more men at the job rather than invest even in simple automation. Now many of them are uncritically replacing humans with hardware. AlixPartners, a consultancy, warns that China risks being “left behind as a failed low-cost-country-model economy”.

Karel Eloot of McKinsey, a consultancy, reckons that most Chinese firms are not even bothering to adopt such global best practices as Six Sigma, which uses statistical methods to ensure quality, and lean manufacturing, which emphasises efficiency and waste reduction. By one estimate, such tools could boost productivity by 15-30%. Instead, many firms are deploying robots to automate their current inefficient ways of working. Mr Eloot would like to see more data, measurement and analysis on the shop floor, with the lessons integrated into work routines.

That may sound too sophisticated, but the PRD’s firms are already showing the rest of China how to leapfrog on smart automation. Consider Ash Cloud’s factory in Shenzhen. This private company makes cheap plastic cases for mobile phones, each costing a few yuan. It sells about 35m of them a year, earning it about $35m in revenues. Although this is a brutally competitive niche, the firm’s profit margin is 10%.

Fred Chen, its general manager, reveals his secret: “Most Chinese firms suffer from production losses, mistakes, scrap, communications and production errors, warehouse mismanagement and so on…our success is due to very good controls.” The firm’s genius is in its manufacturing management system. Every employee has access to it from scores of iPads found all over the factory. There are cameras and sensors everywhere. The iPads display in large type how much net revenue has been earned from each product during a given shift.

A manager explains the advantages: “We have no information islands…radical transparency means no secrets, no turf battles.” Since everybody sees the data in real time, all can change plans on the fly. For Mr Chen the conclusion is obvious: “It is time for Chinese factories to change their management habits.”