Or maybe if that's too broad of a question, let's limit it to China and Korea since both were defeated and occupied by imperial Japan, but have quickly grown and modernized in the past 30 years or so.
What prevented them from modernizing and becoming a major power in the late 19th/early 20th century like Japan did?
Isolationist policies and Japan itself.
The Meiji restoration was in 1868. In 1876, Japan forced an unequal treaty upon Korea and in 1894 the first Sino Japanese War began.
During that time, the Joseon (Korean) court was falling apart. In 1866, the US merchant ship General Sherman was destroyed and all the sailors killed in the Taedong river in Pyongyang. That same year, a French force attacked Ganghwa island in retaliation for Korea's execution of French Catholic priests. A few years later (1871), a US expeditionary force went to Korea and the Ganghwa Incident occured, where the US scored a strong military victory, but withdrew, leaving Korea in its isolationist ways. Every time an opportunity to open up was presented, Korea rejected it, violently.
At the same time, Japan was trading with Europe and the US, gaining knowledge in all sorts of fields: political, industrial, technical, military. Only 4 years later, in 1875, the Japanese would attack Ganghwa, leading to the 1876 treaty.
Politically, the Korean government had become weak. King Cheoljong reigned from 1849 to 1863. He was a distant relative of the 21st king, Yeongjo (1724-1776) and he became king when the 24th king died without an heir. He was put into power by the Kim clan of Andong who had been amassing power and influence for generations by marrying their daughters to the kings. This had caused stagnation to develop and Korea began a downward trend in the early 19th century because of it. Once Cheoljong died, Gojong became king, but due to his age, Gojong's father became the regent. Daewongun as he is known attempted government reforms, but he also persecuted Catholics and kept up the isolationism. Once Gojong and Queen Min (wife) took over, they continued some of these reforms, but the die had been cast. Korea was weak politically and militarily, and it was very shaky socially. The Tonghak Rebellion in 1894 caused the government to call in Chinese troops to help which caused Japan to start the Sino-Japanese War which led to Japanese troops occupying Korea in one form or another until 1945.
All this is not to say that Korea didn't try to reform. The Gabo Reforms, a direct response to the Tonghak rebellion, began in 1894. They were heavily influenced by Japan, but they did help Korea create a more modern bureaucracy. Also, Korea reached out to Russia for help in modernizing around the same time. When the Queen was assassinated, the King and prince hid out in the Russian legation building for a year, and when they finally did return to the palace, they had Russian guards. Russian involvement in Korea and in Manchuria is what led to the Russo-Japanese War a few years later. Korea's attempts at getting other countries to help them out is what sealed their fate with Japan and colonization. The Japanese wanted Korea under their control as a buffer from China and the rest of Asia and when they realized that Korea wouldn't do so voluntarily, in 1910, they annexed the country.
As far as China goes, it's a similar story. The Chinese government had grown complacent and weak. European powers forced their way into China, taking Hong Kong (Britain, Opium War), Qingdao (Germany, 1898), Taiwan (Japan, Sino-Japanese War), plus the Boxer Rebellion resulted in foreign troops occupying Beijing and the government was forced to reform. But it was too little too late and the Qing dynasty collapsed a few years later, paving the way for the Republic of China, then the Civil War, interrupted by the Japanese, only to be finished in 1949 with the PRC coming to power.