Survival, Rona Munro’s last brush with Doctor Who back in 1989, is a story about the rise and fall of civilisations set against the coming of age of a group of self-dependent teenagers, with a great deal of metaphor threaded throughout its science fiction script. To some people, it’s one of the original run’s all-time classics, while for others, its clash of the literal and the figurative and its reliance on an adolescent cast make it rather problematic. In truth, Survival is made up of striking ideas and imagery, but doesn’t quite fit the Doctor Who mould; it’s the format of the series itself that has to bend to absorb it, rather than the story fitting the programme.

Much the same is true of The Eaters of Light, Munro’s return to Doctor Who some 28 years later. Munro, just as Frank Cottrell-Boyce had in his debut script In the Forest of the Night, sets up a delicate balance between the lyricism of her story’s ideas and the rather more prosaic science fictionism of its execution. In order for the plot to work, the audience has to suspend its disbelief for a number of elements that are without much persuasive explanation, such as the physical appearance of the “locusts” that were appearing through the dimension portal – not a million miles away from the Magma Beasts of Peter Davison’s regeneration serial, in that their inclusion was a necessity that robbed what surrounded them of some of its dramatic rigidity – or indeed the temporal properties of the portal itself. The idea of time running at a different speed in the gateway didn’t only give rise to one of the episode’s great comic moments (Nardole informing the Doctor he’s been away for two days), but was also crucial to the construction of the resolution (and its mythical overtone, as highlighted in the pre-titles sequence), and while it didn’t necessarily feel out of step with the rest of the story, neither did it feel quite integrated with the physical reality we were presented with. There was a lot of telling the audience the way things were, without really being able to explain why – just as there had been in Smile and In the Forest of the Night.

The result was a frustrating blend of the absolutely wonderful marred by minor irritations; fortunately, in this instance, the little things mostly didn’t get in the way of the story’s main themes and preoccupations. And some of those preoccupations were delightfully odd, like the talking crows who began the story behaving like a Greek chorus on its ingredients – “Doc-tor!” “Mon-stor!” – and ended up forming its most moving moment; “The crows are remembering,” Nardole tells the Doctor, in a scene that both serves to undermine the Doctor’s superiority in a way that very gently reminds us that the Time Lord’s arrogance has been increasingly a theme throughout Series Ten, but also highlights the manner in which Munro has been using The Eaters of Light to create her own folklore in the truest sense – as a way of explaining the inexplicable and making it comprehensible: folklore exists to make the unexplained less frightening, to humanise it. From the cawing of crows to the hint of music floating over the moorlands, The Eaters of Light answers questions those of us who live away from the barren open spaces would never think to ask.

The plot itself derives from the series’ occasional need to solve an antique mystery for which there has never been a satisfactory explanation; much like Agatha Christie’s temporary disappearance or Nefertiti’s more permanent one, the fate of the Roman army’s Ninth Legion in second century Scotland has never been explained. It’s a bit of a leap of logic to imagine the hitherto sci-fi obsessed Bill also having a predilection for two-thousand-year-old puzzles, nevertheless it gets us into the story and circumnavigates the obligatorily clunkiness of the companion having to be brought up to speed on the TARDIS’ destination. Thereafter Munro’s story thinks itself through and arrives at a lot of logical junctures that help in serving its trajectory, rather than feeling like impositions upon it; the ages of the survivors on both factions, for instance, enable Munro to concentrate her efforts on that crossroad between impressionability and certitude that she mined so well in Survival, the conversation about Bill’s sexuality illustrating the point that learning doesn’t stop when knowledge is attained. The wrongfooting of Bill over her attitudes to the past reflects the Doctor’s appeal to both parties to set aside their imposed and assumed differences in favour of a common goal. To have made each side in the battle so ostensibly similar creates a situation in which it’s as easy to see why the Romans and Pictish would struggle to come to terms just as much as they ought naturally to do so. It’s simple, intelligent storytelling.

And this episode is filled with simplicity and intelligence – and crucially, by comparison with Cottrell-Boyce’s debut offering, creates new mythos around undefined ideas rather than seeking to bring established mythology, such as the Gaia traditions, into the Doctor Who canon. It’s mostly very believably accomplished, but for the odd Magma Beast-alike and its light-eating properties; it’s a shame more wasn’t done with things like the introduction of the black paste that infects Bill – a reference back to Planet of the Daleks maybe? – but overall The Eaters of Light was probably greater than the sum of its parts.

It was also cast brilliantly, the imposed cynicism of the surviving Romans and the willing dedication of the remaining Picts both feeling like natural developments and played with honesty; once again, there was a hint of a reflection of our own times in the story’s concerns. Brian Vernel was a standout as Lucius, but the entire cast was fantastic. And Peter Capaldi was at his best and most Doctorish this week; between Munro’s dialogue and the distinctively Scottish flavour of the story’s themes, he was absolutely in his element. There won’t be another episode in his entire run in which he will have been better than he was here.

The Eaters of Light was also a little reminiscent of The Girl Who Died, in its subject if not its execution, with its concentration on ostensibly unenlightened characters coming to terms with and overcoming scientifically defined issues. Doctor Who has tended to mine our more relatively recent past throughout its history, but lately these trips further back have given it a new texture. And if its solution revolving around an invading force becoming friends with those they were seeking to invade was somewhat similar to last week’s Ice Warriors episode – and reminiscent of the kind of story you might have found in Class or The Sarah Jane Adventures – then at least Rona Munro’s lyrical, thoughtful script was a country mile away from Gatiss’ clunky, predictable adventure.

The coda (presumably an insertion courtesy of Steven Moffat himself) leaves us looking forwards to the two-part finale on a bit of a knife-edge; could Moffat be about to tell a story we’ve perhaps had tucked away in the back of our minds but never thought to actually see, that of the Doctor and his one-time best friend actually enjoying something of that unhindered relationship? Gomez certainly seems to be playing her rehabilitation for real – and the preview of World Enough and Time suggests that Series Ten’s themes, for example, a surrogate Doctor exploring a simulation in Extremis, were no more haphazard than they ever are under this showrunner’s regimes. It’s hard to believe we’re here already, but the pieces that will initiate the twelfth Doctor’s final hours are falling into place.