The galaxy was in chaos in the wake of the pivotal Battle of Geonosis.

The rebelling Separatist factions, no longer concerned with
keeping their alliance hidden from the Republic, began striking
out at targets across the galaxy, first military, then civilian.
The Republic sent its own army to retaliate, and this began the
Clone Wars, thus named from the armies of clone soldiers
fighting for the Republic. The fighting was fierce and intense
for two long years. The Jedi Knights, the guardians of the
Republic, protected the citizens of the galaxy as best they
could, but even they could not stand. The Jedi's fiercest
enemy, the Sith, had returned from the shadows. The Sith were
thought to have become extinct millennia ago, and now they had
emerged from scrutiny to again hunt the Jedi. Thousands of
Republic soldiers and Jedi Knights died in the battles that
followed, and the Separatists continued to manufacture their
battle 'Droids -- mechanized killing machines programmed to take
the place of living soldiers -- to combat the Republic at all
turns. At one point the fighting grew so high near the Republic
capital at Coruscant that his advisors warned Supreme Chancellor
Palpatine to take cover in an undisclosed bunker, where he
continued to command the troops. Hidden and secluded from all
but the best Republic surveillance -- that only he himself had
access to -- this is where Palpatine chose to make known the
consummation of his own secret plot.

He declared himself Emperor.

Palpatine also announced the Jedi as enemies of the state, and
severed all ties between the Jedi order and the new Empire. The
political unrest growing against the Jedi -- which Palpatine
himself had also engineered -- came full force against the
Knights. They were shunned, discarded by the populace at large
as mere mystics with strange, dangerous powers. As soon as the
new servants of the Emperor had ignored the Jedi entirely,
Palpatine sent his chief enforcer, Darth Vader, a Sith warrior,
to seek out and execute the Jedi. The Knights who had survived
the battles with the Separatists went into hiding, or were
slaughtered by Vader's hand. With no Jedi Knights to stand
against him, Palpatine would be in absolute power, with no
threat of opposition. The Old Republic, with the Jedi as its
guardians, was dead, and the Empire was born.