In this year’s FDI Confidence Index, published by A.T. Kearney, Mexico’s ranking plummeted from the third most attractive destination for foreign direct investment – just behind the US and China – to 22nd place. Considering Mexico’s vibrant democracy and membership in NAFTA, this is a shock. Why has Mexico fallen down?

The conventional wisdom has it that Mexico and China are engaged in an epic struggle which only one can survive. And it will not be Mexico. Mexico was – with its plentiful and cheap labor – the preferred workshop for America. But Chinese labor beats Mexican labor handily on both cost and plentitude, so the American factory jobs that had headed south are now heading east. China’s rise is Mexico’s fall.

There is some evidence to bear this out: over the period from 2001 to April 2004, according to A.T. Kearney, one of every four maquila manufacturing plants that had opened in Mexico – representing some 250,000 jobs in all – were shut down. And of the plants that were shut down, approximately one in three reportedly moved to China.

But this explanation for Mexico’s woes makes little sense, as trade is not a zero-sum game. After all, the jobs that moved from the US to Mexico did not cause the US economy to crash. And the US, despite competition from both Mexico and China, remains one of the world’s top investment destinations. Perhaps one could claim that China ought to displace Mexico at the top of the FDI attractiveness rankings. But Mexico fell 19 places in a single year. Something more fundamental must be wrong.

That something else has its roots in Mexico’s colonial history. The Spanish colonial regime in Mexico was established with the express purpose of enriching a few privileged Spaniards. “Economic life [in the colonial era] was organized by highly detailed and particularistic provisions, aimed at granting a complex web of privileges and monopolies,” writes Raymond Vernon, an economic historian. As time went on, an elite group of Mexicans also came to benefit from this system.

And then, in one of history’s great ironies, these rich Mexicans led a rebellion against Spain. The goal was to protect their colonial privileges, which were in danger of being swept away by a program of economic liberalization backed by the Spanish crown. “Mexican independence came through a virtual coup d’état by the colony’s Creole elite, carried out largely to separate Mexico from the liberalizing process under way in the Mother country,” writes John Coatsworth, another historian.

Thus Mexico came into independence as a country ruled by and for a rich elite. Its laws and government were created and preserved with precisely this goal in mind. Much has transpired in Mexico since then – including foreign invasions and a political revolution. But such privileges die hard and each successive generation of reformers has found it hard to put truly equitable institutions in place. A recent paper by James Robinson, for instance, makes the comparison between turn-of-the-century Mexico and modern Russia. Even President Porfirio Diaz – who ruled Mexico almost continuously from 1876 to 1910 – inadvertently created a class of “oligarchs” while struggling to reform Mexico’s elite-dominated economy.

To this day, an elite group of industrialists benefits from a system of law and government that favors their interests, and fails to protect the economic rights of most Mexicans. The result is that while Mexico is now officially a member of the OECD, the club of rich countries, its institutions protecting contracts and property continue to rank among the world’s poorest. The World Bank’s rule-of-law ratings put Mexico just above 50 on a 100-point scale – worse than Ghana, India and even Egypt. On the World Economic Forum’s survey of property rights and contract protections, Mexico ranks a dismal 62nd out of 80 countries.

And this is Mexico’s fundamental problem. Without sound economic institutions, the country is unable to take advantage of the investment it has received. Maquila plants on the Texas border have failed to turn into higher value added manufacturing. NAFTA should have propelled Mexican growth; instead, it has had little impact. The World Bank initially estimated that the first ten years of NAFTA had produced at least some net positive impact – perhaps 0.6 percentage points added to Mexican growth – but this estimate was subsequently revised downward.

In the final analysis, neither NAFTA nor competition from China are the major determinant of Mexico’s economic performance. Trade is an opportunity, not a guarantee. Mexico’s economic institutions – sufficient for the immediate postwar era, perhaps – have been insufficient to turn the country into the sophisticated OECD economy it claims to be. For broad-based and higher value added growth, Mexico will need sound economic law and equitable enforcement.

This article was originally published on Countryrisk.com, before I sold the site to Roubini Global Economics.