One of the hardest things George Lucas and Dave Filoni would have to explain in “The Clone Wars” was how clone troopers could so easily turn on their Jedi commanders. As shown in the series, in most cases the clones are close friends and confidants of the Jedi, bonding with them throughout the Clone Wars and making their drastic personality change with Order 66 of so much harder to believe.
Nonetheless, the two came up with an ingenious idea that provided a workable explanation behind the clones’ sudden betrayal. In the original prequel trilogy, the clones’ nonchalant slaughter of the Jedi is of their own accord. The clones sincerely believe Palpatine’s lie that the Jedi are rising to power, choosing to remain loyal to the Chancellor and the Republic over the Jedi conspirators.
However, this would later be retconned in the final seasons of “The Clone Wars”, with Filoni and Lucas revealing that nearly all clone troopers are implanted with a behavior modification biochip that effectively controls their thoughts and emotions. When activated, they essentially become sleeper agents, with extremely high aggression and hostility towards their fellow Jedi.
Arguably one of the best retcons of “The Clone Wars” series, the whole biochip idea was a masterstroke of brilliance. It explained the change in attitude of the clones from loyal Jedi troops to mindless, mindless killing machines, and helped portray them in a new and tragic light.