The first floor is all about components: every type of switch, every cable and every screw can be found here, often in bags of thousands. The second floor is filled with circuit boards and small gadgets, from video cameras to headsets. The higher you go, the bigger and more sophisticated the devices get: smartphones, drones, hoverboards. On the top floor, the 10th, a blinding cornucopia of LEDs of every shape and color assails the eyes.

The SEG Electronics Market and similar places in the Huaqiangbei district of Shenzhen, a fast-growing city in southern China an hour's drive north of Hong Kong, have been described as sweet shops for hardware geeks. But they are better understood as showcases and sales offices for the thousands of factories in the city's hinterland and elsewhere in China. The people at the markets' booths are happy to sell you items in ones or twos, but they prefer to talk to much bigger customers on the phone.

Huaqiangbei's markets also are a perfect symbol of how dominant China has become in the electronics industry. The country is the core of the sector's global supply chain. Chips and other components pour in, mostly from other Asian countries; they are assembled in China; the finished devices are then sent all over the world. China is home to more than half of the world's manufacturing capacity for electronics, estimates Henry Yeung of the National University of Singapore.

Half of the world's mobile phones are made in China, and almost all of the printed circuit boards, the guts of any device. Chinese factories install two-fifths of the world's semiconductors. Of the production facilities operated by Apple's top 200 suppliers, 357 are in China and 63 in the United States.

This dominance has shot up the political agenda — in particular, in the U.S. America's trade deficit with China and unfair Chinese practices, such as the forced transfer of intellectual property and even outright theft, are the main reasons President Donald Trump has raised tariffs on many Chinese products.

But American officials have other reasons for wanting companies to reroute supply chains. Growing strategic rivalry is one worry. And on Oct. 5, the Pentagon warned that not enough attention had been paid to the security of the electronics supply chain. The day before, Bloomberg Businessweek reported that Chinese agents had managed to implant spy chips on circuit boards used by 30 American firms, including Amazon and Apple. (Both companies have strongly denied the story, although some experts say the scenario is plausible.)

Add China's ambitious plan to move up the electronics value chain, called "Made in China 2025," and it is easy to see why the U.S. is worried. Under former president Barack Obama, the President's Council of Advisers on Science and Technology found that China's policies to foster its semiconductor industry, for instance, "are distorting markets in ways that undermine innovation ... and put U.S. national security at risk."

The origin of China's dominance lay in cheap labor. In the early 2000s, companies in all sorts of industries sent at least some manufacturing to China to stay competitive. Although much production has been automated since, electronics can be labor-intensive even today: components often need to be assembled by hand or taken from one machine to another. Foxconn, Apple's main contract manufacturer, employs 250,000 people in Shenzhen.

In recent years labor costs have gone up — by more than 60 percent between 2011 and 2016, say some estimates. Vietnamese or Indian workers are far cheaper. But China now has much else to offer. Flying into Shenzhen and taking the subway to Huaqiangbei is a breeze. An ecosystem of firms has sprung up to provide everything from logistics to prototyping. Although high-end components, such as processors and memory chips, must still be imported, most other things can be sourced locally.

Other factors also favor concentration. Shenzhen's ecosystem pulls in more hardware-makers the bigger it gets — just as Silicon Valley's dense network of venture-capital funds, law firms and other service providers has attracted more and more startups. And in contrast to other products such as cars, notes Greg Linden of the University of California, Berkeley, gadgets and their components can easily be flown around the world, meaning that making everything in one place does not entail high transport costs.

The question is whether the forces that have pulled the electronics industry into China can be broken or weakened. To some extent, this has already happened. To offset higher labor costs, and to reduce their reliance on one country, some firms have moved some activity. Most prominently, since 2009 Samsung, the world's biggest smartphone-maker, has shifted most of its production to Vietnam, making the country the biggest exporter of such devices after China. U.S. tariffs on goods made in China are pushing others to follow suit.

Some experts have floated the idea of a bifurcation of the electronics supply chain, along with other parts of the information-technology industry such as the infrastructure for mobile networks and even the internet itself. One part would serve the West; the other, China and allied countries.

A complete split seems unlikely: Interdependence in the global electronics industry is too strong for that. But recent events have given U.S. firms an incentive to reduce their reliance on Chinese manufacturing. Chinese firms will feel the same way about American technology, given the near-death experience of ZTE, a Chinese maker of telecom equipment, after the Department of Commerce briefly banned exports to the company, which depends on processors designed in America.

A tech cold war is not yet underway. But things are a lot chillier.