Both Japan and South Korea were relatively poor countries and Japan had been war struck after WWII. (I imagine they had to pay reperations?) but now they are both considered some of the richest and most developed nations. I know they are both in very good geographic locations for shipping to the developing world which is very useful, but that can't be the only reason.
Japan was not a relatively poor country before WWII, as they had just finished modernizing, and had a capable military and navy with a standard of living on par with the European powers at the time. After the war, Japan benefited greatly from the United States occupation, as the United States wanted to ensure Japan wouldn't become a communist state. This is not saying Japan is where it is because of the United States, but rather the United States helped and gave Japan a big boost, and Japan being capable used the boost correctly.
As for South Korea, there are many reasons. South Korea became an industrialized society under Japanese rule. Along with Taiwan, Japan treated South Korea as an extension of Japan, and so Japan poured billions of dollars to improve and expand the South Korean economy and infrastructure to be on par with that of Japan. Directly being under Japan gave Korea a big boost. After the war, South Korea adopted the modern Japanese economic model because geographically South Korea is very much similar to Japan. After the Korean war, the United States and Japan both spent billions of dollars to fund South Korea's economy and infrastructure. Japanese rule and industrialization during the war, learning from the Japanese economic model, and monetary boosts from both the United States and Japan have led Korea to where it is today.