I must admit I'm a little hazy with SW in general, but why did the clones switch sides? I think it was due to some special code being used, but why did they do it? The clones were bred for obedience, but wouldn't switching side be a little questionable?
They were bred for obedience.
And they must obey the one that gave the order, Mr. Palpatine. So you see, they didn't actually switch sides.
In the event of Jedi officers acting against the interests of the Republic, and after receiving specific orders verified as coming directly from the Supreme Commander (Chancellor), GAR [Grand Army of the Republic] commanders will remove those officers by lethal force, and command of the GAR will revert to the Supreme Commander (Chancellor) until a new command structure is established.
It was his plan all along, make a fake war between the droid army and the clone army (in fact, create the clone army due to the fake threat from the droid army), to divert attention, make the Jedi busy, and eliminate them in that one swift blow.
See here for more detailed information
Utilizing the attack by Mace Windu as a pretext, Palpatine issues Order 66, a pre-arranged military command ordering all Clone Troopers to execute their Jedi commanders in the event that the Jedi "betray" the Republic. Darth Vader leads the raid on the Jedi Temple with the 501st Clone Trooper Legion and kills all the Jedi in the Temple, including Jedi younglings living in the Temple.
1I knew they were bred for obedience, but I always thought they could at least think it was kind of weird to be given such a contradicting order. Feb 26, 2011 at 2:11
2That is certainly my take. By "saving" the republic from the Droid army, Palpatine justifies both the clone army, and his leadership of it. Note how he was able to turn on the trade federation, when the time came. Feb 26, 2011 at 17:37
9@Teknophilia, The Clones never switched sides, nor did the Emperor for that matter. The whole war was orchestrated for the sole purpose of killing off the Jedi. Darth Sidious had A LOT of time on his hands. The Clones never stopped fighting on the side or in the interest of the Republic. They just killed the Jedi around the same time he had Anikin kill the CIS leaders and shut down all the droid armies.– Apoc326Apr 13, 2011 at 13:01
13@Teknophilia: No, it's actually the troops believing that the Jedi switched sides and that they (the troops) are still being loyal for the good case.– vszMar 25, 2012 at 12:57
11Mr. Palpatine? I didn't spend years becoming an evil Emperor to be called Mr.– ValorumDec 24, 2014 at 18:43
Here's my reading of this: the Clone Troopers, although actually "picked up" by the Jedi and later lead by Yoda, belonged to the Republic (which was hardly likely to give the Jedi their own private army). Thus, their chain of command went up through the Jedi commanders to the chief executive elected by the Senate to lead the Republic in its times of trouble - Chancellor Palpatine. In any normal situation, they might be expected to be loyal to their generals; but as Juan pointed out above, these guys were bred for obedience. So they would obey their commander-in-chief - Palpatine - over any orders given by the Jedi.
4Sort of late, but remember that the Jedi were originally controlled by the Senate, which is an entirely independent body in relation to Palpatine. Rather, Palpatine convinced the Senate to grant him emergency powers which gave him direct control over the Jedi; this is how Anakin was able to sit in on council meetings as Palpatine's envoy, and it's how he was able to give clones orders in the first place. The chain of command was originally Clones->Jedi->Senate, but after the emergency powers, it became Clone->Jedi->Senate->Palpatine. Whomever is at the top is whom the clones listen to.– ReidJun 24, 2011 at 18:52
According to recently launched Star Wars: The Clone Wars - The Lost Missions (Unfinished Season 6), it was an inhibitor chip embedded inside clones' brains which made the clones anti-Jedi at the time of Order 66.
The inhibitor chip belonged to Count Dooku and Lama Su agreed for this implant under a secret Protocol 66 which was a fail-safe against rogue Jedi.
1If you have inhibitor chips, you don't need clones. Just add them to normal folks. Dec 5, 2014 at 18:01
2@Oldcat No, you can't. It could only be implanted in embryo stage. Bringing lots of pregnant women could be tedious process and there would be high chance of leak. Dec 5, 2014 at 18:10
1That makes no sense. The brain is not developed at that stage. Dec 5, 2014 at 18:11
1Implant where? the elbow? If it has no need to be placed on a particular part of the brain then it is just a magic dingus. Dec 5, 2014 at 18:15
1So it is advanced enough to find the proper nerve, which might not exist until after birth, but can't work at all if implanted later. Baby brains grow tremendously after birth. Its just hand-waving. Dec 5, 2014 at 18:22
Like some previous answers, Mine comes from Star Wars: The Clone Wars series. Season 6. I forgot the exact name of the episode, something like "The Lost."
EXTREME CAUTION!!! GIVE-AWAY AHEAD!!! READ AT YOUR OWN RISK OF SPOILERY!!!
Anyways, in this episode, it begins with a trooper that has a malfunctioning organic chip in his brain. His malfunctioning chip causes him to think Order 66 has already been issued, and he betrays a Jedi in the middle of battle. He later regains his former self, and is brought to Kamino for inspection. A friend of his comes with him, but is not permitted in the area. Later, they find out what did it, and don't tell the trooper who came with the patient. The trooper sort of "goes rogue" and attains a friend who is a Droid that did the procedure. They find the chip, and find out what it does. He gets the chip taken out of his own brain, and tries telling everyone what it does. Everyone thinks he's crazy, and he ends up getting accidentally killed by a fellow soldier. Sad death and blab blah blah. My point is, it was a tumor-like programmable chip implanted into their brains. They pretty much lost their will to obey there generals when Mr. Ex-Chancellor/ Emperor said "Execute Order 66." Im sure you've got the memo.
Here's the catch the reason why is because, if you have ever seen star wars the clone wars tv series season 6 the lost episodes is that here come the spoilers.Chancellor palpating and Tyranus/Dooku, had been with the kaminoens side all along and thought that they were Jedi so they ordered chips to be planted into every clone ate very young stage this is why when chancellor palatine said execute order 66 they all followed cause they were brainwashed into thinking that the Jedi are the SITH and the SITH are the Jedi thus the reason why they betrayed it was a brainwash command
So basically, when Palpatine created the Grand Army of the Republic, he ordered his apprentice, Count Dooku/Darth Tyrannus to put a chip inside of each of the clone troopers. What the chip did was that when the Chancelor tells them to execute "Order 66", they will see all the Jedi as traitors of the Republic and try to destroy them. Even so, there were some clones that disobeyed Order 66 because they had their chips previously remove (like Captain Rex, for example). If you watch the animated series, the Clone Wars, you will learn a lot more about Order 66 and all the clones.
spoilertag also remain, as one could hide spoiler questions? We do that on Gaming, but I haven't participated much here so I don't know if you handle it different.