Up until the 1650s Japan had been isolated from the rest of the world where its government and society were rigidly hierarchical. Moreover, its emergence as a modern world power from 1867 to 1914 was to a certain (large?) extent due to its contact with Western nations, among other factors. These other factors included Japan's own willingness to adopt western ideas and technologies, its success in wars against China and Russia, as well as its strong centralized government and the influence of ideas such as militarism, nationalism and imperialism.
Additionally, Japan was inspired by the Western nations to pursue for the independence that these nations had and at the same time, to defend themselves against them. The need to defend themselves was brought about their realization that they were politically weak when compared with the higher powers within this time period. Firstly, the foreign powers obtained many privileges from Japan, such as the right to apply their own law to their stay in Japan, which lead them to firmly believe that Japan's national right had been violated.
Secondly, the foreign imports into Japan increased notably due to the low tariff fixed by the unequal treaties, which meant that Westerners received more privileges as Japan was suffering from debt. Subsequently, Japan believed they were in danger of foreign attack and needed to stabilize themselves politically and hence took to drawing up Japan's first constitution - bringing the Charter Oath into effect, promoting the new policy of modernization.
Many western technologies and ideas were also adopted as the Japanese leaders encouraged the people to take on a more Westernised lifestyle, unlike in China where the idea was instead strongly discouraged (forbidden?). China had confidence and refused to destroy its traditional values. Japan, however, saw that perhaps, the reason why the Western nations were so significantly more powerful than the Asian nations, may have had to do with some aspects of their culture; they also saw that it would help Japan appear more modern to Americans and Europeans, making them less likely to be taken over. As a result, the Japanese people began wearing Western-style clothing, took up Western habits such as smoking and drinking wine, and modern education was provided in order to level Japan's military and industry with the Western nations. Therefore, western culture was greatly adopted and played a significant role in the modernization of Japan, whilst China still remained unsuccessful some time after that.
Furthermore, the inclusion of militarism, nationalism and imperialism ideologies were also prominent factors in this event. Before Emperor Meiji's rule, nationalism was felt very little within the country, yet after, the people proved their nationalistic attitudes by accepting the Emperor's decision in adopting western culture. From this, militarism then emerged as the military leaders had easy access to the emperor whilst imperialism took a great affect on Japan as the government became aware of the Western nations' extended power over Japan. As a result, these ideologies were undoubtedly fundamental within this era.
Where previously Japan was vulnerable to invasion and its government was far from centralized, with the ruling of Emperor Meiji, it was able to develop and overcome this. Its first debut as a powerful nation was shown in the Sino-Japanese War (1894 - 1895) where Japan impressively defeated China and continued to gain Taiwan and trade privileges. The success was followed up in the Russo-Japanese War (1904-1905) where Japan's victory was even bigger and more victorious. The continual success aided in Japan's own confidence as a nation, and its recognition and emergence as a powerful Asian nation.
In conclusion, Japan's upsurge to power was contributed by a range of factors, but the idea still stands strong, that the most influential factor was its contacts with the Western nations. The other factors may have been significant, yet however, each of these factors are each somehow related back to the Western nations .