Korea is located in the eastern end of Asia, between China and Japan. Geographically, the Korean peninsula was a bridge between the two countries. Advanced culture was transmitted to Japan through Korea from continental Asia, including religions, philosophies, cultural artifacts, and institutions.
Though the location helped Korea to acquire the latest cultural innovations, the peninsula was simultaneously exposed to many invasions from China and Japan. There were three times big invasion from China and one time invasion from Japan. The first fighting between Korea and China 645CE, that time Kogurye, one of three kingdom dynasty defeated. The second one was a Mongolian invasion from 1231 to 1259. The invasion time was counted from 6 to 9 times. As you know Jinghis Khan’s notorious, their invasion was continued until Koryo Dynasty surrendered. Some sholars urged that Korea was a Shield of invasion to Japan. Especially, Mongol was exhausted their military power from several times of fighting with Korea. The third one was Ching Dynasty in 1623 and 1637 Dec two times. From the late Koryo Dynasty period 13CE, Japan started bothering Korea. was watching for an opportunity to expand their territory to the continent. after 13CE. Therefore, Korea had a problem on that, too. In such a tough situation, Korean always struggled to keep their own culture. With Korean’s effort, they keep their own culture though they got lots of influence from China.
p.s : Korea is divided south and north in present days, as you know. North Korea supports communism and South Korea supports capitalism. After they were divided in two, they cultivated their own style. But they use the same language and share a same ancient history.