/u/diana_mn gives a strong overview of the events that led Japan to transition from the Late Tokugawa Shogunate into the Meiji Restoration associated modernization here while answering several questions from other users. This would be a good start and if you have any specific questions feel free to voice them so that specialists can answer them.
(Disclaimer: I'm not at home were my most of my sources are. I only have my kindle which has only a handful of sources. I've listed a few sources and will put the rest up later).
China.
Why China? China's past is both central and the foundation to East Asia's history. This is also assuming you are asking what caused the Meiji Restoration and subsequent modernization.
By the time Commodore Perry appeared on the scene in 1853, the Japanese leadership were well aware of the horrors that brought the Qing dynasty to its knees. Keep in mind that the Qing, at its zentith, ruled what was arguably the most powerful civilization on the planet throughout the 17th and 18th centuries, under the leadership of Emperors Kangxi and Qianlong. By the time the Meiji Restoration began in 1868, The Qing experienced four rebellions; the Taiping, the Nien, the Du Wenxiu and the Dungan. The latter two were still ongoing by 1868. The two Opium Wars arguably left a more profound impact on Japan as it demonstrated Europe's ability to project power across the globe even in the face behemoths like China (China had a population around three-hundred million). European technology enabled Europe to engage in these imperial affairs and Japan knew they medieval era weaponry would no longer keep the barbarian at bay. Faced with the political realities of the time, the Japanese agreed to the unfair trade treaties. This bought them the time necessary for Japan to modernize.
Why bring up the Chinese rebellions? Well for starters, the Taiping nearly destroyed the Qing. Secondly, it was Christian inspired cult whose leader, Hong Xiuquan, believed he was Jesus's younger brother destined to bring down the Manchu devils. In case you didn't already know, the Qing were Manchu. Thirdly, the British and French intervened during the Taiping on the side of the Qing. They supplied the Qing and both organized and lead an army known as the Ever Victorious Army. European intrusion into China also caused the Qing to lose face with the people. This is very important in the context of the Mandate of Heaven. If you lose the will of Heaven, you lose the right to rule over China. This is what allowed ethnic minorities such as the Mongols and Manchu to rule over the Han majority. I.E. The Ming were an ethnic Han dynasty but were replaced by the Manchu Qing.
It also important to note that the Tokugawa were also failing to effectively rule over Japan. I need my notes and textbook to give you proper explanation on this subject. I'll have to get to this later.
The Iwakura Mission is especially important. The new leaders of Japan decided to see the what the world had to offer in education, technology, culture, and military, social and economic structures. With this new found information, Japan was able to effectively modernize allowing the nation to become a major power in the pacific, albeit briefly. In my opinion, the Iwakura Mission is probably one of the most important lesson Japan has to offer the world as it required the people to look outward, rather than inward for a solution.
As for sources go, I'm not at my house and I only have my kindle. I will put the other sources up when I get home later. (There is a textbook about Modern Japan that I have but I can't remember the exact title for the life of me).
Autumn in the Heavenly Kingdom by Stephen R. Platt (a book about the Taiping Civil War)
Japanese Imperialism by W.G. Beasley
God's Chinese Son by Jonathan Spence
The Search for Modern China by Jonathan Spence
The Iwakura Mission to the United States and Europe is a primary source and English translations are available.
Edit: I said China had a population of three million, I meant to say three-hundred million.