The real answer to this question is both simple and complex.
However, it is difficult for the people of South Asia to understand this kind of thinking, based on different cultural concepts. If we discuss this topic in depth, it will cause great controversy.
I will use a simple example. If you can understand this question in depth, you will understand “Why doesn't China provide North Korea with advanced technology for military use?”
China and India introduced Su-30 almost at the same time, Russia provided India with the top version of Su-30MKI, which had all the advanced technologies at that time, while China bought the most basic version of Su-30MKK.
Many years have passed.
China has already surpassed the Su-27 family. China's fully indigenously developed and produced J-16 has surpassed all fighters of the entire Su-27 family.
So far, India is still unable to complete the autonomous production of Su-30MKI.
Decades ago, China customized the JF-17 for Pakistan and carefully taught them to build it. But till today, Pakistan is still unable to produce any subsystem of JF-17. They can only produce most of the JF-17 airframes and the core structural components still need to be supplied by CAC.
North Korea, an extremely closed and backward country.
The HGV technology is a Chinese monopoly and will never be made available to any country. North Korea actually copied the DF-17 just by relying on the appearance of the DF-17 released by China and some civilian technical information.
Putting aside political diplomacy, let's talk about military strategy alone. North Korea's threat to China is far greater than India's military threat to China. If you can understand this theory, you will understand the answer you want to know.