Kim needs medical treatment and the safest place (medically that is) is in China.
Apparently Kim is afraid of flying which is why he uses trains.
His last trip to China was secret. Nobody knew about it until he showed up in the newspapers in China (because the time before, somebody accidently left a truck full of dynamite next to the tracks.)
truck full of dynamite next to the tracks
From examining satellite photo evidence, many believe that it was not a dynamite explosion. Some highly potent material like rocket fuel. Some speculate that N. Koreans tried to enhance missile fuel with adding extra chemicals. Would give missile much powerful propulsion, but highly unstable. Somebody lighted it up when Kim was about to pass by, as the story goes.