Since the early days of American history up until the Civil War, America followed the Monroe doctrine. This essentially meant that there was an unofficial policy of not entering into 'entangling' alliances overseas and intervening in affairs in our hemisphere when America's interests are threatened.
The Civil War however, put a stop to both of these policies. The south actively courted Great Britain for supplies and foreign currency. It exported virtually all the cotton that Britain was using in its textile mills at the time and wanted allies overseas to protect it from the north once it broke away from the United States.
Other countries in Europe also began to look at expanding in the Americas since the United States was in such a weak and vulnerable position. Emperor Maximilian of France took invaded Mexico shortly after the Civil War came to an end when America was still in a weakened position.
Grant felt threatened by this incursion into the United State's sphere of influence and sent a large amount of military aid to the ousted rebel leader of Mexico and stationed about 50,000 federal troops on the southern border of Texas.
Maximillian was eventually killed by the Mexican army and the French army went back to Europe. America once again controlled its center of influence and would expand its reach overseas and to the further out former Spanish colonies, eventually controlling the world in the aftermath of World War II.
It's interesting to think about what would have happened if the French had been able to hold Mexico. It would almost be a reverse Louisiana Purchase. You have to wonder if France and Britain would eventually fight a proxy war in the United States or if the United State's influence in this region would simply diminish.