Relatively far into the episode, we get a good amount of information the Last Great Time War.
GELTH: We are so very few. The last of our kind. We face extinction. Once we had a physical form like you, but then the war came. The Time War. The whole universe convulsed. The Time War raged. Invisible to smaller species but devastating to higher forms. Our bodies wasted away. We're trapped in this gaseous state.
I have to say, this is the episiode where I became a fan. The theatre group I was with for five years did a performance of "The Mystery of Edwin Drood" (referenced at the end of the episode), and as soon as that happened I was a bit like "yes they've got me!"
And, just before that, they quote my favorite play, "Hamlet," with "There are more things in heaven and Earth then dreamt of in your philosophy."