Mexico and the United States have a long, complex and intertwined history. The two countries share a 3,145 kilometer border, and their relationship has been shaped largely by trade and numerous events such as territorial disputes, political tensions, immigration and drug trafficking.

The Treaty of Guadalupe Hidalgo, signed in 1848, ended the Mexican-American War and gave the United States a significant amount of territory in exchange for 15 million dollars.

The Bucareli Treaty in 1923 and more recently the TMEC (also known as the USMCA) are two significant agreements that define the current relationship between the two countries. The first one granted the United States the right to explore and exploit Mexico's oil reserves while supposedly guaranteeing Mexico's sovereignty over its territory. The TMEC, an evolution from the original North American Free Trade Agreement (NAFTA) signed between Mexico, the United States, and Canada in 2018, aims at modernising the trade relationship between the three countries.

The TMEC includes provisions for digital trade, intellectual property protection, labor rights, and environmental standards.

In the late 19th and early 20th centuries, the United States invested heavily in Mexico, building infrastructure, and developing the country's natural resources. However, this investment also led to a growing influence over Mexican politics and an increased sense of dependence on the United States. This dynamic has persisted to this day, with Mexico often feeling the effects of decisions made in Washington, D.C.

One of the most significant moments in recent Mexico-U.S. relations was the signing of the North American Free Trade Agreement (NAFTA) in 1994. NAFTA opened up trade between the two countries and Canada, creating the world's largest free trade zone. While NAFTA brought benefits, it also led to significant job losses in Mexico, particularly in the agricultural sector. This, in turn, led to increased migration from Mexico to the United States.

In 2018, the United States, Mexico, and Canada renegotiated NAFTA and signed the United States-Mexico-Canada Agreement (USMCA), also known as TMEC in Spanish. This new agreement updated and modernized the rules for trade between the three countries. One of the most significant changes was an increase in the percentage of a car's components that must be made in North America to qualify for duty-free treatment. The USMCA also included new provisions on intellectual property, digital trade, and labor standards.

However, the relationship between Mexico and the United States has been strained in recent years. In 2016, then-candidate Donald Trump campaigned on a promise to build a wall on the U.S.-Mexico border, and his administration implemented a number of policies designed to curb immigration, including the separation of families at the border. The Trump administration also threatened to withdraw from NAFTA, which put pressure on Mexico's economy.

In 2018, a new Mexican government led by President Andrés Manuel López Obrador came to power. López Obrador, also known as AMLO, has taken a more confrontational approach to the United States, particularly on issues related to immigration. He has criticized the Trump administration's policies and has been more vocal about Mexico's sovereignty. López Obrador has also sought to diversify Mexico's trading relationships, particularly with China.

Despite these tensions, Mexico and the United States continue to have a close relationship, with significant trade and cultural ties. The United States is Mexico's largest trading partner, and Mexico is the United States' second-largest trading partner, after Canada. Mexican immigrants have also played a significant role in shaping American culture, particularly in the southwestern United States.

Looking ahead, the relationship between Mexico and the United States will continue to be defined by trade, immigration, and political tensions. The two countries still have significant differences on issues such as border security, drug trafficking, and the role of the United States in Mexico's domestic politics. The TMEC agreement will also be a key area of focus in the coming years, particularly as both countries work to implement the new rules and address any challenges that arise. 

In recent years, Mexico has been considered an attractive destination for onshoring due to its proximity to the United States, a large consumer market, and its competitive labor costs. Mexico has implemented various measures to encourage onshoring and attract foreign investment. These measures include tax incentives, improved infrastructure, streamlined regulations, and trade agreements that facilitate access to global markets. TEMEC arrangements are likely to support increasing onshoring efforts by promoting trade and investment in the region.