This article contains spoilers for Foundation episode 5.

Gaal Dornick has returned in Foundation episode 5, and the ending sees her stumble into the plans of Hari Seldon. Inspired by Isaac Asimov's Foundation novels and short stories, David Goyer's Apple TV+ series nevertheless takes great liberties with the original stories. In truth, it has no choice; television is a very different medium, with viewers more drawn to compelling characters than concept-heavy sci-fi. "The first book is kind of anthological," showrunner David Goyer explained in an interview, "and there are these enormous time-jumps that happen in between the stories, and a lot of the characters don't repeat from one story to the next."

Goyer has found ways around this problem by introducing plot devices that allow certain characters to stick around from one time-zone to the next. The best example is cryogenic suspension, with Gall Dornick placed in a cryo-pod at the end of Foundation episode 2 and ejected into space in order to prevent her being blamed for Hari Seldon's murder. The pod was picked up decades later by a mysterious spaceship, and Foundation episode 5 sees her attempt to reorient herself around the new world she's lived in. It's immediately clear she's a pawn in somebody else's game, an experience she understandably finds deeply disturbing.

Related: Foundation's Space Travel Compared To Star Wars & Star Trek

Goyer has routinely compared Foundation to a cosmic chess game between Hari Seldon and the Emperor. The first Seldon Crisis has arrived, the predicted catastrophe upon which the galaxy's entire future will pivot. And, at the very end, Gaal receives a mysterious holographic message from Hari Seldon himself.

Hari Seldon's Hologram Explained

A Hari Seldon Foundation Hologram

It's always seemed likely Hari Seldon orchestrated his own death; his original predictions had been that he would die, executed by the Emperors, and thus become a martyr. But the actions of individuals are difficult to predict, even to psychohistorians, and instead Hari was spared execution and exiled with his followers. It's reasonable to assume Hari ran the numbers and realized his people needed a martyr to rally around, and thus he had Raych kill him. Unfortunately, Hari's plan fell through at the end, because he hadn't expected Gaal to walk in at the wrong moment. Raych bundled Gaal into the cryo-pod in Foundation episode 2, and accepted the death sentence for Hari's murder.

All this fits perfectly with Foundation episode 5, which sees Gaal awaken on a mysterious spaceship that has been programmed only to respond to Raych. Reviewing the ship's records, she discovers a recording of Raych's execution, and he delivers a poignant message to her just before he was killed for his crime. "I know it's hard," he said. "I know what I've done seems incomprehensible, but... you can't lose faith in the plan. Ever. You can still solve a puzzle, even with a piece missing." Apparently Gaal's ship is taking her to Helicon, Hari's homeworld, where Gaal will be forced to perform the role he had originally intended for Raych.

But, in a shocking twist, the computer running the ship projects an image of Hari Seldon. At first glance, it appears to have been recorded just before Hari's death in Foundation episode 2, perhaps meaning he managed to record and transmit a last message when he realized his plans had been disrupted. But there is another possibility: Foundation episode 5 stresses that Hari had a "mortality directive" requiring his body to be ejected into space, in a casket of his own design. It's possible Hari didn't engineer his death, but rather his near-death; that he has faked his murder, staying alive somehow, weak but in cryogenic suspension. If that is the case, then he could have expected to awaken in the care of Raych, but Gaal had no idea this was going to happen, and now Foundation's wounded psychohistorian is near death for real. Rather than a recording, the holographic image could be a transmission from another part of the ship.

Related: Foundation: Why Emperor Dawn Tried To [SPOILER]

The First Seldon Crisis Looms In Foundation Episode 5's Ending

Foundation Anacreon

Meanwhile, on Terminus, the arrival of the Anacreons has initiated the First Seldon Crisis in Foundation episode 5's ending. At last it's becoming clear what the Anacreons want: knowledge and skills, the only precious resource on the barren and hostile planet. The colonists who came to Terminus were hand-picked because they were uniquely suited to preserve the galaxy's knowledge so civilization could be restored after the fall of the Empire, and that means they also possess the knowledge to restore a long-lost battlecruiser - one that, once repaired, would allow the Anacreons to exact their revenge upon the Empire for the havoc wreaked upon their homeworld.

Just as in Asimov's Foundation books, it's becoming clear the whole Foundation project was a cover for Hari Seldon's true plan; after all, it's no coincidence he moved so many knowledgeable people out to the galactic rim, where people like the Anacreons would be hungry to exploit them. This is likely what Gaal Dornick began to realize just before Hari's murder, when she recognized there were flaws in the calculations; the only other person to master psychohistory, she intuited that the solutions Hari was proposing would never work. Now, the true plan is proceeding apace, although tragically after significant loss of life when the Anacreons took Terminus and shot down an Imperial vessel. Salvor Hardin lies at the heart of Hari Seldon's plan for Terminus. The colonists may view Salvor as an "outlier," but Salvor's visions and abilities suggest she is bonded to the Vault - which seems to have been planted on Terminus by Hari, again just as in the books. Only Salvor can navigate the First Seldon Crisis, granted likely with some guidance from Vault visions.

-

There are moments in any game of chess where a single mistake can decide the outcome, and in Foundation the Seldon Crises are those moments. As skilled as Hari Seldon may be at predicting the future, some of the pieces are in the wrong place; Raych was sacrificed to preserve Gaal, which he hadn't foreseen. Still, events are - by and large - playing out as he predicted, his deepest strategies are working, and Salvor is where she needs to be to change the future. The fate of the Foundation hangs in the balance.

More: Foundation: What Exactly Is The Vault? (& Why No One Can Reach It)