The key thing is we don’t know really what happens behind closed doors at World Leader meetings.
The one between Xi and Kim for example could have easily been very tense. Kim is the first of his family to have tried snubbing the Chinese government. And then he also executed and eliminated all the Chinese plants in his government.
There’s a lot of focus on what Trump thinks or might do. But I think long before that, Xi’s plans, or at least the long shadow he casts, for Kim and DPRK may have already played out with most of us unawares. Given that Kim and Xi were not on talking terms, doesn’t anyone think that Kim may have known that Xi would be able to secure a “Presidency for Life”? Won’t Kim fear for his own life once he gets that intel?
Word that Kim was trying to source his weapons program from places like the Ukraine indicates that China definitely was of no help to him. Think of what Xi and his Chinese spymasters would think upon discovery of that.
If you start looking at it this way, then Kim wanting to prove himself as a probable ally of the West begins to make sense.