During the 19th Century, Spain's power and position in the world had gradually slipped, losing their colonies in the Americas and the Caribbean. By the dawn of the 20th Century, Spain's power in the Pacific had long since dwindled down to nothing. Japan, on the other hand, had begun asserting itself militarily and politically. This coupled with Spain's obvious weakness, and with the U.S. having split up into two mutually-hostile states, which kept each other busy and neither of which could afford any intensive involvement across the Pacific.
The decisive battle of the war was launched by the Japanese Navy when they made a surprise attack on the Spanish Pacific Squadron in Manila Harbor, destroying it and allowing the Japanese Army to land and engage the Spanish Garrison there. Blockaded by sea and with no chance of receiving any reinforcements, aid or supplies, the Spanish Army within the city surrendered. However, after the capture of Manila, soldiers of the Spanish Army were mistreated and tortured by soldiers of the IJA. After this major victory, the war was a foregone conclusion, and Spain surrendered to Japan. In the ensuing peace, Japan stripped Spain of all its Pacific territories, including Guam and the Philippines.
Japan's victory made the rest of the Western world stand up and take notice of her emergence as a modern military power. Never had an Asian country so completely defeated a European one. Indeed, Western journalists were forced to leave the Philippines before they could file complete reports on Japanese atrocities there. Skeptics were quick to point out that Spain was hardly a formidable opponent. Nonetheless, Europe had to concede that Japan had arrived as a player on the political scene, and would have to be dealt with as something like an equal.