Mexico is the leading supplier, ahead of Ireland, Germany and China. And few places illustrate this changing landscape, or help explain the complexity of the industry, as well as Tijuana, 20 miles south of San Diego.

The city houses the highest concentration of Mexico’s medical device firms, 70 percent of which are American-owned, according to the local development group. Companies including Medtronic, CareFusion, DJO Global and Hill-Rom-Welch Allyn — some that have their headquarters just up the road in San Diego — have invested heavily in Tijuana, constructing long, low-slung factories tucked into the hilly terrain. Giant banners hanging from manufacturing plants plead for workers to join them.

The high-tech operations emerged after Nafta helped transform Mexican border factories, known as maquiladoras, into industrial powerhouses. Now, instead of being garment sweatshops, many maquiladoras in Tijuana employ a new generation of Mexican engineers and skilled technicians to make orthopedic devices, surgical equipment and catheters.

The factories have helped remake the city’s reputation from a ribald party town to a locus of sophisticated industrial manufacturing. Roadside shanties made of corrugated metal and plastic abut new apartment complexes painted fuchsia and lime green; late-model S.U.V.s bounce along potholed roads. Workers pass through imposing security gates to begin shifts operating advanced machinery or delicately sewing pig tissue onto stents for heart valves, and trucks zip in a steady line across the border in preclearance, fast-track lanes into California.

But the possibility of new protectionist trade policies is already looming over this buzz of activity. The question for many of the people here is whether it will upend the economic incentives that led American companies to invest in the city in the first place.

Mr. Trump has argued that a border tax is needed to keep well-paying jobs in the United States and dissuade companies from relying on Mexican workers who earn a small fraction of American wages. Technicians at medical device factories in Tijuana earn about $14 an hour, compared with about $25 an hour for technicians at factories in the United States.

Critics of Mexico’s maquiladoras system contend that wages are kept unfairly low and that workers have been kept from organizing. For companies, though, the savings are clear — as much as 45 percent for labor-intensive products — and have helped fuel the wave of development here.