Warning: SPOILERS for Foundation episode 2.

In a shocking twist, Foundation episode 2 ended with the murder of Hari Seldon - with the crime committed by his right-hand-man, Raych. Showrunner David Goyer has transformed Isaac Asimov's Foundation series into the grandest game of chess ever played - between an Emperor who opposes change on the one hand, and a genius mathematician who wishes to control change on the other. But the second episode ended in a shocking twist, when one of the players was brutally killed.

Gaal Dornick had sensed something was wrong with Seldon's Foundation for some time. For all Seldon's claims to predict the future using psychohistory, the calculations felt wrong, and that raised the ominous possibility the entire project was doomed to failure. Making matters worse, a strange animosity was building between Hari Seldon and his right-hand-man, Raych, Gaal's lover. Finally, while enjoying a swim, Gaal suddenly realized some as-yet-unrevealed truth and rushed to see Raych and then Hari. To her horrow, when she arrived in Hari's room she found Raych standing over his body, a bloody knife in her hand. Hari Seldon, the great psychohistorian, was dead. But why was this the case?

Related: Foundation Cast Guide & All New Book Characters Explained

The most likely scenario is that Hari Seldon engineered his own death. As Hari himself admitted in Foundation episode 2, he had anticipated being executed on Trantor, and was rather surprised at the Emperor's magnanimity; but then, psychohistory as a science struggles to predict the behavior of specific individuals. Had he been executed, Hari would have become a martyr, and the Foundation would have devoted themselves to his cause with an almost religious zeal. The absence of that deeper motivation would naturally affect the psychohistorical calculations going forward - and thus, it is likely Hari believed it was necessary for him to be martyred in rather different circumstances.

Hari Seldon Death Foundation

If this theory is accurate, then Hari's death was a part of his plan. This would explain the mysterious animosity building between Raych and Hari over the course of episode 2; Hari was beginning to tell Raych what he had to do, and Raych wasn't willing to do so. It is reasonable to assume Hari intended Raych to be the one who used the escape pod seen at the end of Foundation episode 2, although it is difficult to say exactly where that pod was supposed to take him; in the books Hari had secretly established a second Foundation at the other side of the galaxy, so it is possible he wanted Raych to go there. But Gaal's walking in on the crime changed everything, with Raych using the pod to save the women he loved from being implicated in Hari Seldon's death and sacrificing himself as well - because presumably he will face a death sentence for what he has done.

The disturbing question is whether Gaal has warped the calculations further, because after Hari's death, the Foundation could probably have used her knowledge. Worse still, it's impossible to say whether the issue Gaal identified was the one resolved by Hari Seldon's death, or whether there are other flaws in his psychohistorical prediction. The future of the entire Foundation is at stake.

More: Foundation's World Explained: Emperors, Psychohistory, Planets & More