The planet Zanak was once a happy and prosperous place...until the reign of the tyrant queen Xanxia. She lived for hundreds of years, staging galactic wars to demonstrate her powers and ruining Zanak in the process. One day, when hardly anyone was left on Zanak, a ship crashed, killing almost all the passengers. One of the survivors, known as the Captain, required extensive surgery to survive. Part of his left side became cybernetic. The Captain took charge of Zanak and persuaded the people to work for him; presumably, by this point Xanxia had died. The Captain promised the people of Zanak a Golden Age of Prosperity. The mines were automated and unearthed riches galore. When the mines emptied, the Captain would announce another Golden Age of Prosperity, and they would become full again.
What the people did not know was that the Captain was not the benevolent ruler he seemed to be. He had a monstrous temper, and would instruct his cybernetic parrot, Polyphase Avatron, to kill those who displeased him. Worse: Xanxia was not dead.
In fact, her wizened body was positioned between two time dams that had slowed down the flow of time for her. Xanxia's body was suspended in the last few seconds of life. In order to remain mobile, Xanxia used a cell-projection system. This projected an image of a young woman - Xanxia - with permanent regeneration based on the cells in her old body, meaning that the image contained all of the memory patterns and all of the brilliance she had built up over the centuries. The projected image was able to control the Captain by means of a device, probably linked to his cybernetic systems, which caused him to obey her. This process of keeping Xanxia alive, however, required monstrous amounts of energy. Initially, Xanxia gutted Zanak to power it, but the energy was not enough, so she outfitted Zanak - now a hollow planet - with the ability to travel through space and materialize around other planets to suck them dry of minerals and energy. The Captain kept the planetary husks suspended safely in a gallery. In this fashion, Zanak became a planet overflowing with precious stones and other riches.
But Xanxia did not realize that the energy needs of her time dams were exponential. There would never be enough energy in the universe to keep her alive for all eternity, as she desired. She believed that the molecular structure of her projected image was close to being bound together forever, and that with just a few more planets drained, her goal would be achieved. But this was based on a faulty premise, and she could never become fully corporeal. The image was unstable, always dependent on those last few seconds of life sustained in the time dams. Additionally, the release of lifeforce from the planets Zanak consumed caused some of its residents to have mental agony. The blast of psychic energy after each jump smashed open the neural pathways of anyone with telepathic abilities, causing Mentiads - powerful telepaths opposed to Xanxia's schemes - to develop.
The Captain, meanwhile, had been forming revenge plans against Xanxia. His shouting, blustering, and agreeing with her was a ruse to lull Xanxia into a false sense of security while he built his gallery of planets. His hope was that he could use the molecular energy to create a standing vortex in the middle of the time field, so that time would start up again within it and Xanxia's body would die. Although the Doctor was aware that it was destined to fail, the Captain tried to activate it, but Xanxia destroyed him before he could do so. In the end, Xanxia's projected image was dispersed after being shot with one of the guards' weapons, and the Doctor and Romana blew up the time dams.