A man with the office of Keeper of Traken contacted the Fourth Doctor for his help. He explained about the Melkur on Traken and asked for help preventing the evil from taking control of the bioelectronic Source that was the keystone of the Keeper's power and of Traken civilisation. The Doctor and Adric agreed and the Keeper pulled the TARDIS to Traken.
The Keeper had chosen Tremas as his successor. When Tremas came under suspicion with the Doctor and Adric about the Melkur, Kassia was chosen by the consuls to replace him. However, she was working with the Master.
When the Keeper died, Kassia became connected to the Source. Immediately, she was taken over by the Master, who became the new Keeper.
Adric and the Doctor sabotaged the connection to the Source and forced Melkur out of the Keeper's sanctum, allowing Luvic to take Melkur's place and become the new Keeper of Traken. (TV: The Keeper of Traken)