This is the canon theme of Star Wars leaing up to the Clone Wars between the Galactic Republic and the Confederacy of Independent Systems.
The Clone Wars (22 BBY19 BBY), also known as the Clone War and the Great Clone War, was the name given to the major galactic conflict fought between the Galactic Republic and the Confederacy of Independent Systems. The war was named after the clone troopers utilized by the Republic against the battle droid forces of the CIS. These armies, the Grand Army of the Republic and the Separatist Droid Army, were two of the largest ever pitted against each other in galactic history, and the fighting between them rapidly spread to countless inhabited worlds. Beginning with the First Battle of Geonosis, both sides scored significant victories over the other, and at different times during the war either seemed likely to triumph. The death of the Confederate Head of State Count Dooku during the Battle of Coruscant and that of the Confederate General Grievous during the Battle of Utapau, coupled with the issue of Order 66 and the deactivation of the droid army, brought an end to the fighting. At the time, it was the largest galactic conflict to date.
Unbeknownst to most of those involved, the conflict was started, maintained, and eventually ended by the Dark Lord of the Sith Darth Sidious, whose ultimate goal was the transformation of the Republic into the Galactic Empire with him as Emperor as well as the eradication of the Jedi Order through the Great Jedi Purge. The conflict led to the Order of the Sith Lords controlling the dominant galactic government.