It's a good question and one that has never been answered, really, when you get down to it. Philip Martin doesn't know - his lengthy novelization doesn't actually explain anything and is full of errors, like the way it cliffhangers into Attack from the Mind instead of Terror of the Vervoids (and the less said of the Time Lords turning Peri and Yrcanos into an American wrestling tagteam the better). Colin Baker didn't know at the time and if Eric Saward knew, he just didn't fucking care. I think it says a lot that I, Overthinking Ewen, spent six years convinced Mindwarp was a three-part story that ended with Peri getting shot because that fitted the trial sequences better than if you watch the fourth part and suddenly the Doctor is getting shit for not saving Peri by the people that actually stopped him saving her and he's forgotten his vendetta instantly.
On top of this is the fact we are given three overlapping explanations for what we see in the evidence - the Doctor has gone mad, is playing a game, or various combinations with added damaging evidence from the Valeyard who can alter entire narratives (see Terror of the Vervoids, where a blatantly false scene where the Doctor snubs Mel become vital to the plot, as without it the Vervoids would never be awoken.) The Master grunts that "most of what you saw was true" but that's hardly a clarification - he could be talking about the whole story or just the last few minutes of it.
So, what actually happened?
Part One is clearly very close to accurate. The Doctor finds no real holes in the evidence (in the book version, this is a bluff and he is completely amnesiac) and until the cliffhanger all the Valeyard's objections are basically negative interpretations of what we see - even the Doctor killing someone is not suggested to be more than recklessness. So, let's look at part one...
So, 3rd July 2379. The Sixth Doctor and Peri arrive on the barbaric world of Thordon in the territory of the Tonkomp who are lead by a "dirty old skullcracker" who immediately wanted to bonk Peri. The Tonkomp are at war with the Krontop, lead by King Yrcanos, who has greater numbers, strategy and basically all the advantages. However, the Tonkomp have CD phasers that they use to kill and stun their enemies. The Doctor is suspicious and realizes some outside force is operating on Thordon, supplying advanced weaponries to a primitive culture. While Peri avoid the Tomkomp Warlord's advances, the Doctor tries and fails to work out where the weaponry is coming from.
Krontep forces attack Tonkomp territory and although the Krontep are eventually repelled, the Tonkomp folk are slaughtered. The Warlord is skewered and bleeds all over his CD phaser, which he uses to fend off the invaders and save himself, the Doctor and Peri. The Warlord dies, begging the time travellers to help his clan by providing more futuristic weapons - "Thoros Beta," he croaks, "Send more beams that kill..."
With the CD Phaser, the Doctor and Peri flee to the TARDIS and immediately set course for Thoros Beta...
All right, that's all clear enough. It tallies with what's said on screen, and the Doctor doesn't dispute it. But does any of what we see next actually happen?
The TARDIS arrives in the pink sea by the blue shore with the brown horizon and the pink sky. The Doctor and Peri emerge and head to the cave. That definitely happens, but that dialogue? Could it be the Valeyard has rewritten all this to provide info-dump for the court? Because it beggars belief that the Doctor, despite knowing Thoros Beta is Sil's home planet, wanders a beach wondering who could possibly be behind the weapons sales. It's like the Doctor telling everyone they've landed on Skaro and wondering why there aren't any stairs. He even says it's absolutely obvious Sil and the Mentors are behind it all - so why the hell are he and Peri wondering in the first place? It makes the Doctor and Peri look stupid.
So, I'm calling bullshit on that. The Doctor realized what was going on back on Thordon. He told Peri Sil and the others were behind that and decided to go to Thoros Beta to bring those sluggy bastards down. Peri was reluctant but agreed as she actually kind of liked the dirty old Warlord. That's why they landed on the shore, to deliberately sneak in through the back door into Thoros Betan territory.
The Doctor and Peri are sneaking in through the back door. It's not a secure location because the Raak is there, operating the sea engine. Here we come to the "why did the Raak go apeshit?" Question. No one in the trial argues that the Raak didn't attack first, so we can assume that was the case. But even if the Raak hulked out, we're supposed to believe an apparently friendly fish-man crept along a service corridor breathing heavily on the off-chance there'd be intruders?
Surely it would be more likely for the Doctor and Peri wandered into its crib, the Raak saw the Doctor was holding the CD phaser and THEN went apeshit. The Doctor's claim the phaser went off by accident seems true - if he'd deliberate fired, the Raak would have liquefied like the boulder. So, the Doctor and Peri have unwittingly killed the Raak, they know they're in hostile territory. Presumably they did not, as shown on TV, stand around discussing the sea engine - perhaps they argued that maybe this plan wasn't working and they should get the hell out of there.
Frax and the others turn up. Obviously in the real version the Raak's corpse was more obvious, hence the accusation of murder. Now, why would they think the Doctor's a mate of Crozier's when he turns up annanounced waving Mentor-issue weaponry? Surely they're more likely to think the Doctor and Peri are gun-runners, perhaps even rival Amorb folk come to steal the merchandise.
So... are we supposed to think that Frax and the others are so stupid they'd fall for the "skiddadle" test ruse or that a dead coworker has been winking at Peri? If we think this bit is even vaguely credible, it's more likely Frax threw them down to the Lukoser and expected them to get eaten as revenge. Or perhaps not.
You see, we know from Sil and Kiv's chinwag that they've decided that the Tomkomps on Thordon were a bad deal and have decided to let them lose. The Mentors will be making a deal with Krontep's Warlord, Yrcanos. The fact that they are deciding this AFTER Yrcanos is on TB being brainwashed shows that this is another invented scene. So, let's assume that some time has passed since the Tonkomps fell. Yrcanos and his equerry Dorf have been convinced to come to Thoros Beta to sign contracts. Yrcanos is taken to be pacified and brainwashed and Dorf... is turned into a werewolf and thrown down a corridor? That seems remarkably odd and vey quick too - it seems, on screen, they've only been operating for Yrcanos that afternoon. Hell, why turn Dorf into a werewolf anyway? How does that help? If anything, they should at least put the werewolf-transformation to the back of the queue until Yrcanos is pacified...
So..... Frax decided to have the Doctor and Peri locked up with Dorf. Frax then goes to Crozier to tell him about the Raak, interrupting Crozier and Kani brainwashing Yrcanos. Given that the Doctor and Peri are locked up, Crozier would demand they be taken to him for interrogation. Such a big deal is made over whether or not the Raak went crazy, this bit can be said to be true.
Now, what's up with Kiv? Apparently, his brain is going to grow so big his head is going to explode because he's a mutant and also this happens to most Mentors the older they get. And apprently Kiv is a really clever, vicious cunning bastard. It does not make sense, therefore, that Kiv would be constantly putting off treatment. And this is a civilization that can genetically upgrade creatures - are we really thinking Kiv couldn't get someone to cut open his head and weld some more bone there to prevent it? Or just take his brain out altogether and put it in a Morbius-style tank, which we see Crozier does with some poor sucker's brain?
So we can say that the stuff with Kiv is not exactly how we see it. Given his god complex at the end of the story, it's more likely Sil is the one desperately trying to get the operation happening - he is genuinely terrified of Kiv dying before Sil knows "all his secrets" even before the idea he might get executed for failure. So, Kiv is refusing to stop working and the blinding pain in his head. Sil decided that Thordon can wait, and goes down to find the Doctor and Peri being interrogated by Crozier.
On TV, Sil inexplicably just turns up, sees the Doctor and Peri have been unplugging Yrcanos and then assumes - for some reason - that this is because they've finished pacifying him. And Crozier doesn't correct him. That's unbelievable. So more likely, Sil decides to have the Doctor brainwashed even though they haven't finished with Yrcanos. Interrogating him over whether or not he shot the Raak seems a bit petty, but if Sil knew the Doctor was on Thoros Beta to stir up a rebellion, it would make sense to go to any lengths to find out what the hell he's up to. Sil's worried he's going to be promoted before he's ready in charge of a planet with a thriving rebellion and now the Doctor's in town.
So, the helmet is used as we see...
The Doctor on screen admits everything from after his brain was fried is hazy, but also says "the emphasis is all wrong" and we see events occur not quite the way they happened. So...
Yrcanos wakes up, trashes the lab and saves the Doctor and Peri. Makes sense. Sil isn't brave enough to have him killed and Yrcanos presumably has a warrior code to stop him murdering Sil. Yrcanos' first thought is to rescue Dorf, and he bonds with Peri slightly. Seems clear enough.
The Doctor, Peri and Yrcanos head to the induction centre (conveniently where Sil and Frax are) and then stuff starts to become less clear. The Doctor shouts out, blowing their cover and refuses to help either Peri or Yrcanos. This bit is so utterly unrealistic it has to be a fake - but a fake of what. The real Doctor claims to have a clever ploy, and going back to the Mentors saying he's been turned into a money-obsessed backstabbing bastard's a pretty good ploy all told. I'd rather rather than singing "Look out behind you!" the Doctor went right up to Sil and begged for his life; Yrcanos is unsubtle enough to cause his own ruckus and Peri would not necessarily panic like that.
Let's assume the Valeyards padded this episode out with material to make the Doctor look like a dick and simplify it. The Doctor betrays Yrcanos and Peri - instead of them escaping, they are actually captured right away. This cuts out the contrivance of Yrcanos happening to stumble across Dorf, or the idiotic idea Peri might meet Matrona Kani (who for some reason can't remember meeting Peri five minutes ago) get turned into a slave and then betrayed by the Doctor. Again.
The real Doctor says this was a ploy to interrogate Peri alone and the Valeyard confirms that this interrogation happened. Now why would the Doctor want to interrogate her alone? If he'd gone mad or evil, that doesn't explain it. He knows Peri is clueless about any conspiracy, so he'd be better advised just running for it if he wants to survive. But if it's a ploy, that's something else. In the interrogation, for all his shouting and ranting the Doctor tells Peri there's a thriving rebellion, Kiv is dying and Crozier is planning a brainswap. Now assume the Doctor and Peri went there to specifically to bring down the Mentors and the Doctor is faking his madness - and suddenly he's contrived to tell Peri everything she needs to know about what the Mentors are up to and that there's an army waiting for her to lead.
The cliffhanger's rather odd - the Doctor stops in the middle of a corridor for no reason to let Peri insult him and then Brian Blessed turns up. But if Yrcanos was locked up with Dorf, that cliffhanger couldn't happen. Unless the Doctor was taking Peri back to the cell. And then let her free the others, with the idea of going to find the rebels, it makes sense. It also makes Peri's rescue of him more credible in the next episode.
So, we have Peri, Yrcanos and Dorf heading to meet Tuza and the rebels. Tuza is unimpressed, but eventually comes round. But Frax, knowing the rebellion is about to kick off, finally activates the booby-traps, ambushes the survivors then recaptures them. Presumably what we saw was close enough (bar some of the ghastly dialogue and the padding with the crayfish fight).
The rest of the episode? Well, presumably the Doctor (still acting evil) returns to the Mentors as they prepare for the operation with Kiv.
But that brings me to a big problem, a credibility hurdle. Crozier has a machine that is designed to alter brains without any tedious cutting about, which he calls the Brain Transfer Unit. He uses "direct transfer" to put the consciousness of Kiv into Peri's brain. Even in the distant future of the 2370s, surely that's a whole different discipline to cutting out brains and wiring circuits to them?
Yet Crozier seems to go from "brain swapping" (with all the difficulties of tissue rejection, et all) to "mind swapping" in one afternoon without warning. He measures up Peri for a brain swap and then decides mind swap instead. What's the point of all these cranium exams and blood tests if they don't matter? It all points to one thing - Crozier was never going to do anything with brain swapping, just mind-swapping. Which means the "conveniently identical dead relative with wasp sting that has no plot point at all" stuff is all invented by Valeyard to make the Doctor look like a total jerk by helping out with an operation.
I mean, Sil manages to find a perfect doner at ten minutes' notice that they have TO BRING BACK TO LIFE and goes wrong in absolutely every way, including the old bloke's brain taking over... It's ridiculous. And a waste of time. It makes no sense. Neither does the sequence where the Doctor tells Sil where to invest cash and this is somehow seen as a bad thing by Kiv (WTF?) but not by the Time Lords?
So, the simplest explanation is that there was no operation. Kiv insisted on talking to the Possikar delegate instead and its his brain compression not some schizophrenia that ends the problem. Meanwhile, Crozier is working on his mind-swap technology. It makes sense he'd turn down the Doctor (Time Lord mental defenses, etc) and be looking for someone whose brain could handle the stress.
So, the last episode. Peri, Yrcanos and Dorf are in a cell. Kiv's brain is deteriorating. If Kiv dies, the Mentors will be ruined and the Doctor can lead the revolution he turned up to start in the first place. Crozier is getting ready for the brain transfer. The time to act is now.
The Doctor drops the act (and it has to be an act, or we're supposed to seriously think the Doctor's mindwarp was cured by one of Sil's marshminnows). Even on the TV version, the Doctor knows the gang are locked up and so would presumably go and free them. For whatever reason, Peri is taken to the lab and Crozier decides she'll be good enough. For some reason. Quite possibly, given his plan to keep moving Kiv's mind, Peri is just going to be a temporary measure rather than the yellow Chris Ryan clone.
Wasting no time, the Doctor, Yrcanos, Tuza and Dorf kill Frax and smash the brainwashing machinery, turning all the Alphan slaves freaky. Dorf is killed in the fracas and the Doctor and the others run to rescue Peri when the Time Lords intervene. Now, it is credible the Time Lords will take an interest in Crozier's possible marketing immortality (given how similar things are Solon with Morbius with immortality-brain-harvesting bollocks). But it makes no sense for them to abduct the Doctor right now when he's clearly on the verge of stopping things, so it's obviously the evil Time Lords abducting Doctor the first chance they get to claim he's conducting himself unbecoming a responsible Time Lord.
So pretty much all we're seeing in this episode is true. Now we reach the moment the TARDIS vanishes with the Doctor and he's sucked down to the trial station for a proper dressing down.
Theoretically, everything past this point is in even bigger doubt. We know the Inquisitor was told a version of events the Master says was partially faked, but the Doctor is not on trial because of Thoros Beta - that's just an excuse to arrest him after his trip to Ravalox.
So what do we see? Crozier wires up Peri and swaps her with Kiv while giving a strangely demonic rant explaining in very simple terms precisely what Sil should have noticed. That's obviously dodgy, but the basic tenant is that the experiment works and is carried out before Yrcanos, Tuza and/or the Doctor could have got there. But is this what happened?
Well, I think it's fair to say it's a simple either/or - either Crozier finished right away, or he didn't. If he didn't finish, then the Doctor and gang could have stopped it happening and ended the threat to all future evolution. Of course, the Time Lords wouldn't want him to do that because they want to cast him in the worst possible light, so it makes sense they'd abduct him before he could reach Peri.
Given the Time Lords openly admit to freezing Yrcanos and Tuza in a time bubble - something that must cause a shitload of paperword in Time Lord bureaucracy - we can assume that bit is real, but maybe the details are blurred into the following...
Crozier is about to download Kiv into Peri. Yrcanos is about to attack - the Time Lords freeze him. Crozier succeeds in downloading Kiv. Adjust the sequence of these events without even changing them, and the Valeyard makes it look like the Time Lords are dealing with a problem instead of causing it: Crozier downloads Kiv, Yrcanos is about to attack and is then frozen (ostensibily to wait for the moment of maximum advantage - but given Yrcanos just smashes his way in shooting, it's hard to imagine what advantage is being given especially as "anarchy has broken out").
So the Time Lord have let Crozier succeed, giving them the justification to crash and burn the whole thing - making the Doctor look like a moron and also meaning he can't take anyone out for cross-examination since they're all dead. Thus, Peri is possessed by Kiv and his empty body dies. Both Crozier and Kiv start ranting like psychos in this bit, completely unlike their former selves so we can assume some dialogue was altered (perhaps they were discussing the Doctor and his imminent rebellion, which would cast the Doctor in a better light than the prosecution wants).
The time bubble snaps, Yrcanos and Tuza smash their way into the lab and blow up Sil's chair. Peri/Kiv shows a surprising lack of survival instinct or business acumen - s/he stands up in plain sight screaming she is the lord and master who should be protected. Instead of, say, ducking. And telling people to stun Yrcanos for future work. That seems a bit wierd. The way Tuza stands there politely while the guards do fuck all is also a bit surprising. And just what does Yrcanos think is happening? Does he know about the brain-swap?
I think we can assume that, again, the emphasis is all wrong.
Now, we know Peri survived. We know Yrcanos made her a queen and with Peri's desire for home and the fact she kinda liked Brian Blessed, it's possible she was up for this. Ghastly though it is, Peri and The Piscon Paradox does have a point when it says that the various factions of Time Lords would all want to make sure Peri survived rather than have a vengeful Sixth Doctor after their blood. BF have also agreed Peri survived, as did Sil, though Thoros Beta and the Mentor monopoly was broken.
So... what happened?
Philip Martin's lacklustre sequel - Antidote to Oblivion - reveals that whatever it was, Sil survived and Kiv was replaced by Lord Mav. Thoros Beta is still run by Mentors but they're cash-strapped and desperate for new investments. Sil is well-aware that the Time Lords were active on Thoros Beta. The Doctor admits he has no idea what happened, leading to this exchange.
DOCTOR: I can’t believe the Time Lords would have executed young Crozier. But only Sil knows the truth – don’t you, Sil?
SIL: It pains me to remember. When the time storm abated, the great Lord Kiv, whose magnificent mind was supposed to have been placed within the repulsive body of the Doctor’s young companion, was no more. Lord Kiv was dead. Dead!
DOCTOR: I knew it.
SIL: Young Crozier had failed my masters; how else could I have appeased them but by having him ‘fired’ … so to speak?
For Sil, many years have passed (he can barely remember Peri's name but heard bad things happen to her) and has convinced Crozier's daughter her father was sucked into a time storm at the Doctor's doing rather than his own execution. Thoros Beta, Yrcanos, the revolution are old hat.
Adrian Rigelsford's The Monsters is the best and indeed the only explanation for what happened in the shootout-time-storm:
Yrcanos and the Thoros Alphan rebels were armed and would attack the lab. The first blast killed Crozier and his assistant, the second disabled [Sil's] mobile conveyance unit. It was then that Yrcanos turned on Lord Kiv. The girl had been intended as his bride; his barbaric mind could not comprehend the sight of the magnificence that confronted him, and he opened fire.
But that is not how the mighty Kiv died. King Yrcanos knew nothing about the weapon he was using; the blasts aimed at Lord Kiv were stun blasts. The impact, however, was enough to eradicate the brain of Lord Kiv, allowing the intelligence of the girl to reassert itself. King Yrcanos carried the body away, leaving the carnage behind him. Lord Kiv's mind had been ejected into nothing due to Crozier's lack of competence, [insisting the mind of the girl no longer existed]. As to the fate of the girl, she is now known to be Queen Peri, King Yrcanos' lady of the Krontep Empire.
Between them, we can see a logical pattern forming.
To summarize what happens after the Doctor was abducted.
Yrcanos and Tuza raced towards Crozier's lab, picking up some more rebels on the way, only to be frozen in time. Meanwhile, Crozier completed the transfer. The time-freeze snapped and Yrcanos and Tuza tear into the lab, beating the shit out of the guards as everything goes blurry and wibbly. Peri/Kiv yells for back-up as she and Sil "run" for it. Yrcanos sees Peri and realizes that the experiment is over. He clobbers a guard, steals the phaser and fires upon Peri - knocking her to the ground.
Yrcanos nukes the BTU and it explodes. Crozier makes a run for it with Sil as Peri opens her eyes and dazedly sees Yrcanos. The big bloke scoops her up into her arms, letting Tuza and the others smash the place. Sil sees Kiv is gone and has Crozier executed while he retreats to the other mentors into some bunker, perhaps even temporarily abandoning Thoros Beta in the Possikar delegate's spaceship.
Together with the Alphans, Yrcanos and Peri leave Thoros Beta in ruins. Except, it's not Peri now (as The Widow's Assassin relates) but someone pretending to be her. In apparent disgust at the Doctor's abandoning her in 24th Century deep space and seemingly deciding the Doctor can go and get fucked, Peri and Yrcanos leave right
away and head to Thordon which is renamed Krontep by Yrcanos.
The Doctor eventually searches the ruins of Thoros Beta, suspicious of why Peri wouldn't even wait a day for him to come back heads off to Krontep. A few months have passed and Yrcanos and Peri are arranging their wedding - making contact with Thoros Alpha and plenty of other interplanetary empires, importing new technology to Krontep. When the Doctor finally arrives "Peri" isn't in the mood. She locks him up in the cellar and gets on with marrying Yrcanos but in ten days the latter is dead from poisoning...
But that's another story.