Amid the fuss over US president Donald Trump’s first meeting with Chinese president Jinping Xi, the visit of Mexican foreign minister Luis Videgaray to Washington DC earlier this week went almost unnoticed.

It was a decidedly less flashy affair than the reception for Xi at Trump’s Mar-a-Lago resort—no one was asking what Videgaray ate during a series of closed-door meetings with US officials. But tightening ties with Mexico could prove a more practical strategy than wining and dining Xi, when it comes to counteracting the “massive deficits” and job losses Trump is trying to stem.

While Trump has dished out criticism fairly equally against China and Mexico for what he sees as lopsided trade, the nature of the US’s relations with the two countries is very different. Mexico and the US build products together; the US—and Mexico—mostly buy goods from China.

By integrating their economies even more, the US and Mexico could become more competitive against their Asian rival. The renegotiation of the North American Free Trade Agreement, or NAFTA, presents an opportunity to do that. As the two countries, plus Canada, gear up for revamping the 23-year-old agreement, they should bear in mind how disruptive China has been to trade flows among NAFTA’s three partners.

An uninvited guest

China didn’t figure into NAFTA’s original negotiations in the early 1990s. Back then, it represented but a sliver in North American trade balances. Instead, NAFTA focused on making its three members more competitive globally. During its early years, trade among the US, Mexico, and Canada soared.

But North American integration began to unravel after China joined the World Trade Organization in 2001. In just a few years, it became a major exporter to both the US and Mexico.

In the US, China’s share of American imports grew much faster than Mexico’s and eventually overtook it.

Meanwhile, the US’s share of Mexican imports has shrunk considerably while China’s steadily climbs.

Those trends are not just a function of a bigger trade pie with more pieces for all. China has been eating the US’s share in Mexico–and Mexico’s share in the US, according to Enrique Dussel Peters, coordinator of the Center for China-Mexico Studies at National Autonomous University in Mexico. China has essentially barged into the NAFTA party like an uninvited guest (Spanish), as the title of a 2013 paper by Dussel Peters suggests.

For example, in 2000, US goods accounted for nearly 70% of Mexico’s synthetic-fibers imports. Nine years later, American synthetic fibers were down to half of Mexico’s imports; China made up nearly 15% of them, up from virtually zero in 2000, per Dussel Peters’ analysis.

Mexico’s access to cheaper inputs from China should have made its own synthetic-fiber exports to the US more competitive. In fact, by 2009, Mexico’s share of the US’s synthetic-fiber imports had dropped to 1% from 15% in 2000.

Overall, Dussel Peters calculated that around 60% of American exports to Mexico are directly threatened by China, while more than half of Mexico’s exports to the US are directly or partially threatened by the Asian country.

Despite NAFTA, both the US and Mexico are having a hard time competing with China, with which neither of the two countries have a free trade agreement. Like the US, Mexico has a bulging trade deficit with China.

Rules of origin

NAFTA wasn’t designed to defend its members against cheap Asian goods, but it could be repurposed. One way to achieve that is by modifying the treaty’s rules of origin, which dictate how much of a product’s content has to be made in North America in order to be traded within the region duty-free. In general, NAFTA requires that 50% to 60% of products’ value be created within the region, according to Patrick Leblond, a senior fellow at Canadian think tank Centre for International Governance Innovation.

Some observers suggest raising those limits would boost manufacturing in NAFTA countries—at the expense of China and other Asian countries.

Focusing on rules of origin also makes sense because they are not as controversial as other potential topics on the NAFTA renegotiation agenda, such as tariffs or conflict-resolution mechanisms. It’s an area where the three countries could reach an agreement.

That’s not to say it will be easy to strike a deal, or that the final result will be the perfect solution. Leblond points out that enforcing rules of origin is complicated and costly. The paperwork for a single product can stack up 100 pages high, he noted in a March paper (pdf) on how to update NAFTA.

And upping the required North American content could end up making NAFTA products more expensive and less competitive.“The big question is whether there is a way to structure the rules of origin to increase supply chains across of North America, or will they hurt the supply chains,” said Geoffrey Gertz, a postdoctoral fellow at the Brookings Institution.

In a recent draft letter to notify Congress of the Trump administration’s intention to renegotiate the trade deal, acting US trade representative Stephen Vaughn proposed changing rules of origin to support “production and jobs in the United States.”

Just weeks before the draft letter was circulated, Mexican officials had huffed (link in Spanish) about modifying rules of origin–they want them to apply not to single members but to the whole region. But at an April 6 press conference, Videgaray seemed open to discussing them more generally after his recent meetings in Washington.

“As days go by, and we hear from people in the administration… it becomes clear that we may not be that far apart, in the sense that it should be a negotiation that strengthens the region, that enhances integration, not separates us,” he said.