Star Wars: The Clone Wars has been building up to Order 66 all along. According to Matt Stover's novelization of Star Wars: Episode III - Revenge of the Sith, the Clone Wars were the ultimate Jedi trap. They scattered the Jedi across the galaxy, leaving them vulnerable; furthermore, they transformed the Jedi into soldiers and warriors. "Wars do not make one great," Master Yoda would later observe, no doubt remembering the moral compromises the Jedi were forced to make during the Clone Wars.

The Clone Army was a crucial part of the trap. They had been commissioned by Jedi Master Sifo-Dyas when he saw visions of a coming war, but the Sith had incorporated the clone army into their plan. The Sith murdered Sifo-Dyas, and had the Kaminoans implant biochips to control clones and turn them against the Jedi. This came to a head in Star Wars: Episode III - Revenge of the Sith, when the clones slaughtered the Jedi at Darth Sidious' command.

Related: How Clone Wars Season 7 Avoids A Darth Vader Plot Hole

Star Wars: The Clone Wars season 7 will bring that story to a dramatic conclusion. The last few episodes have been running concurrently with Star Wars: Episode III - Revenge of the Sith, and as a result it's only a matter of time before Order 66 is issued. But the story has been setting this up for a long time - particularly in The Clone Wars season 6.

A Hitchcockian Thriller About A Rogue Clone Trooper

Clone Wars Tup

The Jedi had served alongside the Clone Army for years without incident - until The Clone Wars season 6. This began with a sinister story featuring the clone trooper named Tup, who went rogue during the Battle of Ringo Vinda. Tup's biochip malfunctioned, and he became profoundly anti-Jedi, murdering General Tiplar and forcing a Republic defeat. Darth Sidious and Count Dooku realized something had gone wrong with this particular clone, and hurriedly attempted to recover Tup. They failed, in large part due to the concern of Anakin Skywalker, and Tup was sent back to the cloners of Kamino for analysis.

The Kaminoans claimed Tup had been exposed to a virus causing him to go rogue, but Tup's friend Fives uncovered the truth. He had a medical droid excise what appeared to be a tumor, and discovered the slagged biochip. The next few episodes were a Hitchcockian thriller in which Fives tried to learn the truth behind the chip, and uncovered a conspiracy he believed went all the way to Supreme Chancellor Palpatine himself. Darth Sidious revealed the true purpose of these biochips to Fives; that they allowed total control over the clone troopers, turning them into the perfect weapon to be used against the Jedi. He then framed Tup as a traitor, and the clone trooper was killed while trying to present an incoherent report to Anakin Skywalker and Rex. It seems Rex and a few other clone troopers suspected the truth, and according to Star Wars Rebels Rex was able to extract his own biochip and those of a handful of allies.

Even the Kaminoans did not know true purpose of the biochip. They believed the biochips had been implanted as a failsafe to guard against rogue Jedi, and considered the whole thing to be a curious example of Jedi politics. In reality, of course, the biochips transformed the clone troopers into the perfect weapons to be deployed against the Jedi. The Jedi would never be able to sense animosity and thus impending doom, because the clone troopers would only turn on them when Darth Sidious issued Order 66.

Related: Star Wars: The Clone Wars Reveals Maul Started The First Rebel Alliance

Sifo-Dyas Became A Dangerous Loose End For The Sith

Star Wars Clone Wars The Lost Ones

The Sith faced another problem towards the end of the Clone Wars, when the Jedi stumbled upon evidence of Sifo-Dyas' assassination. Count Dooku attempted to cover up his involvement in Sifo-Dyas' death, but he was unsuccessful, and the Jedi finally realized the Sith were the ones responsible for the creation of the Clone Army. Unfortunately the Council knew they were in too deep, and they would have no choice but to play the game to the end. Sadly, the Council never informed rank-and-file Jedi of the truth - and thus only a handful of Jedi had any sense of the impending doom that was Order 66.

More: Clone Wars Is About To Make Order 66 More Tragic Than The Prequels Did