Ever since the end of the second world war, Korea has been split into two separate countries that have technically been at war for over 50 years. Originally, North Korea was sponsored by the Soviet Union as acted as one of their satellite nations during the cold war, sparking the Korean War in 1953. When it looked like the U.S. was about to win and reunite the country, China stepped in with thousands of troops that fought the U.S. lead U.N. forces back to the border before the war.
After the ceasefire, both sides militarized their borders and there they sat for 60 years. Since then, their main benefactor, the Soviet Union, have since collapsed, leaving only China to support their regime. That regime has devolved into a military dictatorship whose people are repressed and starved to the point of collapse. The North Korean population has created a difficult problem for the region. If the government were to fall, the humanitarian crisis that would develop would dwarf the reintegration of East and West Germany.
China is in the difficult position on the global stage. While they might not like North Korea’s war mongering, they can’t just cut support as the government would collapse and cause an even bigger problem. People would pour in from the south into Manchuria, while South Korea would have to spend trillions to reintegrate the north and population who have been conditioned to hate their neighbors since birth. While the world may frown upon the support the north receives from China, it has been carefully calculated has the least worst option.