What exactly does China get out of supporting North Korea

You can do a search on this and get a ton of links, but I’ll link to few that jumped out at me (actually, in all honesty, the first few links since I’m just a lazy bastard):

In addition to the above and in the other links (and, full disclosure, I didn’t read through them all), you also have the fact that China is responsible for most of the hard currency in North Korea (well, the legal hard currency I suppose), which is what allows North Korea the ability to buy any of the stuff they can’t get from China. All this said, though, understand I’m using ‘China’ very broadly here…a lot of this, especially the technology transfers being speculated on aren’t coming officially from the current faction in control of the CCP…they are coming from several other factions within China. But this is something that’s been happening for a LONG time. It’s what enabled North Korea to initial build the first weapons they tested, and what’s enabled them to build more and more sophisticated bombs and missiles.