As PLA Marshall Zhu De famously said during the Korean War, China and North Korea are the “lips and teeth”: irrevocably connected, partnered. The Sino-DPRK relationship was based on a shared Marxist/Leninist ideology, a history of Japanese occupation, and an alliance against the US and UN during the Korean War.
The post-Cold War landscape is worryingly different from Pyongyang’s perspective. China is much closer to the US, Japan, and South Korea—China’s #1–3 trading partners, respectively—and China’s main policy goal is modernizing and strengthening China through a strong domestic economy, which requires regional stability. Therefore China’s policy on North Korea is two-fold: to dissuade Pyongyang from advancing their nuclear and missile technology; and to economically support the DPRK in order to avoid state collapse.
China is North Korea’s #1 trading partner and only major ally, but the PRC doesn’t approve of North Korea’s state sponsored crime—terrorism in the 1980s, kidnapping, drug trade, counterfeit, and extortion—and North Korea’s nuclear tests are a blemish on China’s international reputation. China views North Korea as a liability to regional security, and therefore Pyongyang potentially endangers China’s economic growth. As North Korea acts belligerently and the international community scoffs and calls for sanctions, China responds by increasing economic aid—not out of loyalty, but in order to prevent the country from collapsing and causing regional turmoil with potential humanitarian and refugee crises, “loose nukes”, and political complications surrounding possible Korean reunification, a US-ROK joint administration of the North, and a squabble for the largely untapped natural resources therein. Beijing worries that any pressure or decrease in economic support could result in a crisis.
The ideal situation from the Chinese perspective is a so-called “soft landing” in the DPRK: economic and political reform from within which mimics China’s semi-capitalism without tumultuous regime change.