Japan had been an isolationist country until 1853. In 1853, four American warships sailed into Tokyo bay. These warships had the express intent of forcing Japan to be more open to western trade and influence. This was not an invasion, it was more like forced economic relations.
The Japanese government was the Tokugawa Shogunate. While there was an emperor, this was mostly a figure head. The Shogunate were regional military dictators. Under Shogunate rule, the Japanese economy had an issue. The Shoguns relied on the taxation on the agriculture. However this did not provide enough capital for the Japanese society.
In order to protect Japan from a potential European threat, a group began to form in Japan. The Meiji wanted to reform the military and the industries. Many resisted this idea, and a brief civil war broke out as a result. The reformers(Meiji) won and put in place the reforms they wanted. Often called as the “Meiji Restoration”.
The Meiji began to rapidly industrialise. They viewed the United States and Europeans as dangerous competitors. This is often called defensive modernism. They poured all of their money into industrialisation. They created new markets for their goods such as Korea.