Yeah, as Shoozza said, demo recording is based on packet dumps. I would say that using packet dumps is far from the best way it could be done.
I have plans to improve the way demos work later though (sometime after 1.5.1 is released), to include more extensive data, mainly from the player who's recording, but also from several other aspects of the game if server demo recording is enabled. More information on that when I get to it...