Wait, the Sontarans are invading Gallifrey? Why? They’re whole thing is unending war with the Rutan race of shapeshifting assholes. Why would they want to invade Gallifrey? Time Lords are a completely different race of beings who sometimes shapeshift and may or may not be assholes.
Regardless, there are Sontarans on Gallifrey. It looks like the Doctor’s plan to open up the planetary forcefield to stop the Vardans let the Sontarans in, and that’s what the Sontarans want. They also want the Doctor but don’t know who he is. The Doctor insists he’s just the President, and they can call him “sir”. Sontarans don’t call anyone outside their chain of command “sir,” so that means it’s time for a pain stick!
Fortunately, the Doctor used a specific series of phrases, allowing his old mentor the Chancellor to hit the whole room with a sonic attack. The Time Lords (plus Leela) stumble out. Except the Castellan. No, he stumbles over to the Sontarans, and…wait, I knew that guy was a weasel, but he’s also in charge of planetary security, so, how did this guy get that job?
Never mind. The Doctor gets himself, Leela, Andred, Rodan, and the Outsiders down to his office to find the Chancellor and K9. It doesn’t take much to get the Chancellor on board with not killing everyone who isn’t the Doctor, so the Doctor sends the others on ahead with K9 to get back to the TARDIS.
By the by, if you’re thinking Leela would want to fight, then you’d be right. Of course she does. And if you think Leela can’t kill a Sontaran, well, this must be your first episode of the show to feature her in it. All the Doctor had to do was tell her the only weak spot on a Sontaran and she nailed it with her knife.
Anyway, after the Doctor convinces the Chancellor to give up the Key of Rassilon. Rassilon, of course, was the first leader of the Time Lords, and the president of the council gets to carry all of Rassilon’s best stuff. And the Sontarans really want Rassilon’s stuff for some reason.
Anyway, Leela, the Doctor, K9, Andred, Rodan, and the Chancellor all manage to get to the TARDIS.(separately) and only lose a couple nameless Outsiders. The Doctor asks Leela to take the Chancellor somewhere deep into the TARDIS, Andred and K9 to see to defenses, and Rodan to rewire the TARDIS and effectively take care of the Sontarans. Heck, all the stuff the Doctor did before effectively meant no one outside of a working time capsule could do much of anything.
But the Castellan has already sold out the Doctor to the Sontarans and he can do something that appears to be plunging the TARDIS into a black star. That sounds…bad.