Clone troopers were an army of identical, genetically-modified clones, created to serve in the Grand Army of the Republic during the full-scale intergalactic conflict that came to be known as the Clone Wars. Grown at an accelerated rate and raised in the laboratories and facilities of Kamino, the clone troopers were trained throughout the first ten years of their lives to become one of the most efficient military forces in galactic history. Bred for the sole purpose of combat, the clones were indoctrinated with unwavering obedience to the Galactic Republic and—more specifically—their Commander-in-Chief, the Supreme Chancellor.
For roughly three years, the clone troopers fought to defend Republic sovereignty against the Separatist rebellion. Throughout the conflict, the members of the Jedi Order served as commanders and generals of the Grand Army and, thus, they served alongside their clone soldiers on many occasions. But the covert Sith plot to seize control of the galaxy, masterminded by the Sith Lord Darth Sidious, effectively caused the clones to betray and destroy the Republic that they were sworn to protect with their lives. Sidious, in his public guise as Chancellor Palpatine, issued Order 66 to the clone troopers on the eve of the Clone Wars' end.
The contingency order declared that all Jedi were traitors to the Republic and, hence forward, subject to summary execution. Due to their inability to disobey any order, the clone troopers carried out the Chancellor's command without question. Though a small percentage of clones ignored the order, the vast majority of the clones executed their unsuspecting Jedi officers, many of whom had come to trust the clones with their lives.
In the aftermath of the Jedi Order's near destruction and the sterilization of the Jedi Temple on Coruscant, Palpatine abolished the Old Republic and instituted the Galactic Empire in its place, with himself as emperor of the galaxy. Among the many new reforms that symbolized Palpatine's New Order, the Republic clone troopers were re-designated as Imperial stormtroopers. Without the guidance of the Jedi, the first generation of stormtroopers quickly established a reputation as the brutal enforcers of a galactic-spanning despotic regime.