The Rule Of Two: Explaining The Star Wars Rule That Has Quietly Defined The Sith
"Star Wars" has always been a fight between good and evil, light and dark. Even though the first film really only had Vader as a Force-using villain, and we knew nothing of his part as a fallen Jedi, the idea of the eternal conflict between Jedi and Sith would come to define the franchise at large.
Much of the history of the Sith, their ideology and their organization, had been explored in the expanded universe. In the 1990s, comics like "Star Wars: Tales of the Jedi" chronicled the start of the Sith Empire and its many wars against the Jedi and the Republic, then the games "Knights of the Old Republic" and its sequel expanded on the mythology of the Sith years before Anakin killed younglings and turned to the dark side.
Audiences wouldn't hear the word Sith in canon until "The Phantom Menace" (it was mentioned in a draft of the original film and its official novelization). By then, George Lucas put his own headcanon onto paper and established what came to be known as The Rule of Two. The only thing close to an explanation for it comes near the end of "The Phantom Menace," where Yoda says, "Always two, there are. No more. No less. A master and an apprentice." But where did the rule come from and why is it important? For the answer, we have to take a deeper dive into Lucas' own private worldbuilding from before the prequels as well as the expanded universe.
Always two there are
In the real world, the Rule of Two came about because George Lucas had already decided that the Emperor/Vader structure of a master and an apprentice was ingrained into Sith culture for centuries. According to the retired filmmaker, at some point, the Sith ruled the galaxy, but their greed and selfishness drove them to infighting and killing each other.
Things went on this way until only a Sith called Darth Bane was left. Bane then took on an apprentice and from there on, the apprentice would kill the master once they became powerful enough, and then take on another apprentice who would eventually replace the new master. We see this in the movies, where Sidious keeps replacing his dying apprentices, from Maul to Dooku and then Anakin. Anakin's goal is to kill Palpatine and take Luke as his apprentice until the Jedi redeems his father and breaks the cycle.
Though Bane was mentioned in "The Phantom Menace" novelization, it wasn't until 2006 that his story was properly told in a trilogy by Drew Karpyshyn. Bane destroyed the Sith Order to create a new one and instituted the Rule of Two which would ensure there'd never be more than two Sith at a time, with the transfer of power from the master to the more powerful apprentice resulting in the Sith growing more powerful with each cycle.
Things changed, however, when Darth Plagueis decided to go against the doctrine and attempted to unlock the secret to immortality with his apprentice Darth Sidious, who then betrayed and killed his master and tried to finish his master's experiments of immortality. By the time of "The Rise of Skywalker," Sidious kind of succeeded. So as of now, Palpatine technically broke the rule before definitively dying in the canon.