Prior to the Civil War, the United States was in search of foreign markets to export their goods to to offset the surpluses of economic and agrarian material being produced in the country and bring stability to the economy. In 1854 Commodore Matthew Perry bombarded Edo Bay and opened Japan to trade to a western country for the first time. Japan was to serve as a coaling station for American ships to reach the most lucrative foreign market in the Pacific: China. China had already fallen under the economic influence of countries such as the British Empire, the Dutch, and the Portuguese by this time and there was a sense of urgency for the United States to get in the market in order to offload their economic goods. This effort to find foreign markets for American goods was interrupted however by the Civil War just six years later.
The Civil War allowed for the manufacturing capacity of the northern states to sell their goods to the war effort. Following the Civil War, the manufacturing capacity in the north that had been devoted to the war effort was sustained through reconstruction. The supplies necessary for policing the southern states was enough demand that the economy experienced stability. However, following the compromise of 1877 and the inaguration of President Rutherford B. Hayes, Reconstruction ended. The United States soon experienced a series of economic bubbles and depressions as a result of massive surpluses.
The need for foreign markets carried into political movements calling for the freedom of colonies in the western hemisphere. The potential of ridding European rule over colonies in the western hemisphere -- in particular Cuba -- would've opened up new markets for the United States to export to. In 1898 the explosion of the USS Maine in Havana harbor most likely happened as a result of a catastrophic boiler failure. However, the press in the United States hyped the incident as an act of war and combined with the calls for Cuban indpenedence the United States was on a warpath with Spain. The Spanish American war became a global affair in which the United States secured Spain's holdings of Puerto Rico, the Marianas Islands, and the Philippines as well as administration of Cuba. The holdings in the Far East that were gained served as launching points for economic influence on the lucrative markets of China and Japan. Foreign markets had now been secured for the U.S. manufacturing economies.
The legacy of the Spanish American War was that the United States had found markets to export its large surpluses to. In the Far East, and the Western Hemisphere the United States had secured economic influence and formed. The policy around the Caribbean -- where President Theodore Roosevelt referred to as our "back yard" -- became known as the "Big Stick Policy" and was an aggressive form of protecting the Americas from any further European influence. In the Pacific, the United States' colonial adminstration of the Philippines and the Marianas served as a means of projecting American influence economically and imperially for the first half of the 20th century.