I am tremendously over-simplifying all this:
Commodore Perry arm-twisted Japan into signing it’s first-ever treaty (trade agreement) with any country in 1854. The rest of the 19th century was a mad-dash of western expansion into the East. Everyone wanted a piece of China, Japan, Korea and anyplace else they could buy, grab or conquer. Japan, in the period known as the Meiji Restoration of that half-century, began a steady rise of industrial, commercial and military power. The Japanese were also driven by empire-building and by the end of the century staked claims on Korea and Manchuria. In 1894 Japan declared war on China (First Sino-Japanese War). In 1904, Japan declared war on Russia (over who would claim Manchuria). (Japan was willing to cede Manchuria to Russia in exchange for Russia ceding Korea to Japan. Russia was not.)
Japan declared war on Russia on Feb. 8, 1904. But, three hours before Russia knew they were at war, The Japanese Imperial Navy attacked the Russian fleet anchored at the Manchurian fort Port Arthur. (Sound familiar?) Over the next year, both the Russian Navy and Army were vanquished. It was a complete victory for Japan. Thoroughly-shocked Russia sued for peace.
President Theodore Roosevelt offered to host a peace conference mediation between the two countries, which resulted in the Treaty of Portsmouth (N.H.) in 1904. Roosevelt (who won the Nobel Peace Prize for his work), sided with Russia on a major sticking point. (He was threading a needle over which “frenemy” would end up with more power in Asia.) Japan won every land and sea battle and sued for reparations from Russia. Roosevelt took that off the table, and the Treaty was signed with no reparations. The people of Japan were outraged by this unforseen turn of events. The day after the treaty was signed, the people of Japan erupted in anti-American riots in Tokyo, resulting in widespread damage over the next three days. Martial law was imposed.
More threads in the tapestry.