China and North Korea have been fighting a minor war over the collection of intelligence inside North Korea. While the North Korean border is, technically, closed very tight, the border guards can be bribed, and North Korea has given up trying to stamp that out completely. So China is able to get spies (usually Chinese who are ethnic Koreans, as are millions of people in northern China) into North Korea, and use cash to recruit more North Koreans as spies, so that China will have a better idea of what is going on inside North Korea. This battle has been going on for several years, and got really serious back in 2003, when North Korean agents paid a large bribe ($300,000) to a Chinese intelligence official, to get the names of Chinese agents operating inside North Korea. The agents were rounded up, interrogated and, most of them were killed. The Chinese were not happy with this, and stepped up their intelligence efforts, bringing in some top talent to make it happen.
The Chinese now have a pretty good idea of what is happening inside North Korea, courtesy of their new agent network. In fact, the new espionage effort has worked it's way up the North Korean chain of command, to include some senior officials. This has made the North Koreans fearful that the Chinese are planning a coup. The Chinese may not be doing that, but it is known that there is a "pro-Chinese" faction within the North Korean government. This group wants to reform the economy, like China has done (and is urging the North Koreans to do). But the "royalist" (pro Kim dynasty) faction fears too much prosperity. That's because, with more wealth, would come more information about the outside world. North Koreans would thus discover how they have been royally screwed by the Kim dynasty. That might create a violent reaction, and the death or exile of the current leadership.
Meanwhile, the intelligence war has now gotten more violent. On October 16th, five North Korean operatives, in civilian clothes, entered China, and tried to kidnap a Chinese intelligence official from a Chinese military base near the border. There was a struggle, there was gunfire, and at least one Chinese soldier was killed. The North Koreans, who apparently failed in their "snatch and run" mission, were seeking to get names of North Koreans working for Chinese intelligence inside North Korea. "Invading" Chine to carry out this task is pretty bold, but not unusual for the North Koreans. Naturally, the Chinese are not happy. The Chinese demanded that the North Korean "raiders" be turned over, but the North Koreans refused. That enraged many senior generals in the Chinese army, who are demanding that something be done. Like revoking the "Mutual Defense Pact" with North Korea. Or maybe supporting a coup to remove the current North Korean leadership.