He’s super smart. I’ve always thought that an idea he has for a comic starts as part of a funny and/or interesting conversation he was having with friends or colleagues. Then later he remembers some of them and makes comics out of them.
If the planets remained in conjunction as they went around the Sun, yes. The planets don't wander as though they're attached to the spoke of a wheel though... and as I click through the explainxkcd link, it seems that someone else has pointed that out, albeit in other words.