After World War II, the United States rebuilt Japan's economy. There's no mystery to this. In fact, it's easily explained: Japan hosts U.S. military bases, which are essentially occupied forces, and the country is essentially a U.S. protectorate, with its economy serving to support the dollar-based financial system.
However, the situation with China is more intriguing. In order to finally split the already bad relations between China and the USSR, Nixon in 1972 offered China to host production from the United States (China would provide cheap labor), which eventually made China a global factory. Gradually, China became a powerful economic force.
An important difference between China's financial system and Japan's is that while the yen is a "derived" currency from the dollar (like the ruble or the euro), the yuan is not based on the dollar. This does not mean that the yuan is highly reliable. China, like the United States, has financial system issues, but it does indicate the independence of its financial system.
Japan is not the only country that is hosting the US military base. There are also some of these bases in poor or developing nations. China is not the only source of cheap labour for the United States. These factors you mentioned played an important role in the development of this country, but the most important factor is quality leadership. Japan and China were fortunate to have leaders who were sincere, less corrupt, and had the interest of the people at heart. My take is that no matter how poor a counntry is, if they have the right leaders, they would develop.
I agree. And this is also important. A lot depends on the government. If the government is a comparador, then investments in economic development will be stolen. Since comparadors are usually also incapable of anything (but cunning), then those investments that were not stolen will be stupidly wasted. However, if the country has no money and resources at all, then even the best leader is unlikely to achieve much.
I foresee a counterexample: "What about Lee Kuan Yew? Singapore has no resources. But the great ruler brought the country into the first world." But Singapore has always had a very valuable resource - its geographical location. The transport route through the Strait of Malacca is as important as the Strait of Hormuz. A resource is not necessarily money or natural wealth.