Crouched on the ground in a dimly lit factory, women picked through the discarded innards of the modern world: batteries, circuit boards and bundles of wires.

They broke down the scrap — known as hazardous electronic-waste, or e-waste — with hammers and raw hands. Men, some with faces wrapped in rags to repel the fumes, shovelled the refuse into a clanking machine that salvages usable metal.

As they toiled, smoke spewed over nearby villages and farms. Residents have no idea what is in the smoke — plastic, metal, who knows? All they know is that it stinks and they feel sick.

The factory, New Sky Metal, is part of a thriving e-waste industry across southeast Asia, born of China’s decision to stop accepting the world’s electronic refuse, which was poisoning its land and people. Thailand in particular has become a centre of the industry even as activists push back and its government wrestles to balance competing interests of public safety with the profits to be made from the lucrative trade.

Last year, Thailand banned the import of foreign e-waste. Yet new factories are opening across the country, and tons of e-waste are being processed, environmental monitors and industry experts said.

“E-waste has to go somewhere,” said Jim Puckett, executive director of the Basel Action Network, which campaigns against trash dumping in poor countries, “and the Chinese are simply moving their entire operations to southeast Asia.”

“The only way to make money is to get huge volume with cheap, illegal labour and pollute the hell out of the environment,” he added.

Each year, 50 million tons of e-waste are produced globally, according to the United Nations, as consumers grow accustomed to throwing away last year’s model and acquiring the next new thing.

The notion of recycling these gadgets sounds virtuous: an infinite loop of technological utility.

But it is dirty and dangerous work to extract the tiny quantities of precious metals — like gold, silver and copper — from castoff phones, computers and televisions.

For years, China took in much of the world’s electronic refuse. Then in 2018, Beijing closed its borders to foreign e-waste. Thailand and other countries in southeast Asia — with their lax enforcement of environmental laws, easily exploited labour force and cosy nexus between business and government — saw an opportunity.

“Every circuit and every cable is very lucrative, especially if there is no concern for the environment or for workers,” said Penchom Saetang, head of Ecological Alert and Recovery Thailand, an environmental watchdog.

While southeast Asian nations like Indonesia, Malaysia and the Philippines have rejected individual shipments of waste from Western countries, Thailand was the first to push back more systematically against the electronic refuse deluging its ports.

In June of last year, the Thai Ministry of Industry announced with great fanfare the ban on foreign e-waste. Police made a series of high-profile raids on at least 10 factories, including New Sky Metal.

“New Sky is closed now, totally closed,” Yutthana Poolpipat, head of the Laem Chabang Port customs bureau, said in September. “There is no electronic waste coming into Thailand, zero.”

But a recent visit to the hamlet of Koh Khanun showed that the factory was still up and running, as are many others, a reflection of the weak regulatory system and corruption that has tainted the country.

Despite the headlines about the police raid, New Sky Metal was fined a maximum of only $650 (£490) for each of its licensing infractions.

Since the e-waste ban, 28 new recycling factories, most dealing with electronic refuse, began operations in one province east of Bangkok, Chachoengsao, where Koh Khanun is located, according to provincial statistics. This year, 14 businesses in that province were granted licenses to process electronic waste.​

In October of this year, the Thai legislature unveiled loosened labour and environmental regulations for all factories, a move that has benefited the e-waste industry. Under one provision, small companies are no longer subject to pollution monitoring.

At the same time, a draft bill that would ensure tighter control over Thailand’s e-waste industry has languished in legislative purgatory.

“Thailand is welcoming environmental degradation with its own laws,” said Somnuck Jongmeewasin, a lecturer in environmental management at Silpakorn University International College. “There are so many loopholes and ways to escape punishment.”

The consequences are frightening.

If some types of e-waste aren’t incinerated at a high enough temperature, dioxins, which can cause cancer and developmental problems, infiltrate the food supply. Without proper safeguarding, toxic heavy metals seep into the soil and groundwater.

Locals who fought against the deluge of trash have been attacked.

“Why don’t you in the West recycle your own waste?” said Phayao Jaroonwong, a farmer east of Bangkok, who said her crops had withered after an e-waste factory moved in next door.

“Thailand can’t take it anymore,” she said. “We shouldn’t be the world’s dumping ground.”​

At King Aibo Electronics Scrap Treatment Centre, one of the factories near the temple, schedules written in Chinese note the dates that shipments will be arriving. The three workers in the office on a recent visit were all Chinese.

“We know that Chinese people set up factories in Thailand,” said Mr Banjong of the industrial works department. But he said that since the ban on e-waste was instituted, “we are more strict.”

King Aibo is one of the factories that began operations this year.

Other factories never shut down, despite repeated infractions.

In September, Sumate Rianpongnam, an activist, campaigned against the e-waste industry’s polluting his hometown, Kabinburi. That night, men on motorcycles shot bullets into the air near his home and raced off.

Shortly afterward, men in a pickup truck tossed small grenades, known as Ping-Pong bombs, at his friend’s house. The grenades exploded, but the friend was not injured.

Others weren’t as fortunate.

In 2013, a village chief spoke out about the illegal dumping of toxic waste. He was shot four times in broad daylight. The man charged with ordering the killing, an official in the local Department of Industrial Works, was acquitted in September.

Mr Rianpongnam and his friend were campaigning against a landfill that illegally mixes electronic waste and household rubbish. On a visit to private land adjacent to the landfill, muscled men packed in a pickup truck tried to block the path out.

“I’ve chosen to do this work,” Mr Rianpongnam said. “I am not scared of death.”

In the shadow of the corroded smokestack at New Sky Metal, Metta Maihala surveyed her eucalyptus plantation. The lake that waters the farm has clouded over, and the smell is nauseating.

Suddenly, through the rows of trees, a pair of Burmese workers emerged. The man showed burns on his arms from his work at New Sky Metal but said he had no idea what liquid had caused his wounds.

The woman, Ei Thazin, said she received $10 a day for sorting metal. “I didn’t know this was dangerous work,” she said.

In Thailand, millions of undocumented workers from poorer countries like Myanmar and Cambodia are vulnerable to abuse, environmental watchdogs said, adding that the need for such labourers will only intensify.

Of the 14 factories granted licenses to process e-waste this year in Chachoengsao Province, six are in Koh Khanun. Five are linked to the man whose name is associated with New Sky Metal, or with his wife.

“We can’t choose the air we breathe,” said Ms Maihala, the eucalyptus farmer. “Now there will be even more factories. We are all going to die a slow death.”