The Clone Wars did not seem to end, even though the Jedi worked hard to strategize. The military-industrial complex grew rapidly as military power was accumulated in a balanced manner on both sides.
Senators taking bribes from the military-industrial complex empowered the supreme chancellor and military commissions while promising the people an end to the war. A disorganized legislature was slow to make decisions and could not function properly, so the powers of the supreme chancellor were strengthened so that he could act immediately without the need for debate.
When the Chancellor declares this, the Jedi guards him with an excessive amount of security. As the war drags on, he decides to unite the Republic in a centralized effort to deal with the national crisis of "the war that will not end.
The only thing the Jedi feared most was that the Chancellor would suffer a breakdown in the Republic's government if something happened to him. They believed it was a plot by Darth Sidious. He also suspected that Sidious was secretly controlling the war itself from behind the scenes by passing strategic military information about the Republic to the CIS.
After the death of Count Dooku, the whereabouts of General Grievous are easily discovered by the Chancellor. The council dispatches its best masters to ensure that the war is ended. This is reported to Anakin, and to his surprise, the Chancellor reveals himself to be Darth Sidious himself, the one the Jedi were looking for. In other words, Palpatine himself and Dooku were connected behind the scenes, so he was controlling the war and rapidly accumulating power under Sith rule.
When the maces learn of this, they immediately decide to arrest and detain the chancellor.
However, since there are few other good masters, they fail to get Palpatine's return. Shortly thereafter, Sidious issues a secret order 66 to all the clone soldiers, and the purging of the Jedi takes place.
The Speaker's speech to the Emergency Assembly.
"For three years, the Jedi deliberately leaked military intelligence to the CIS to prevent the war from ending, carefully keeping the military balance on both sides intact. In the Senate, centralization accelerated and I became a natural dictator. In other words, the Jedi, after setting me up as a dictator, were planning to take over the Republic, which had become a prosecutorial dictatorship, with an eventual assassination attempt!"