Sparta led the defence of the Greek mainland up to the defeat of the Persian in 480-479 BCE. Athens led the second phase of organising the protection of the liberated cities in Asia Minor thereafter until peace in 449 BCE.
Presumably defeating the invasion was the critical part.
The Persians would have won if Sparta and Athens had not united to fight the Persian Army
The Persian Wars
Sparta and Athens were allies against Persia in the Persian War.
On tthe Persian side, the Persian king. On the Greek side, first Sparta, then Athens.
Athens and Sparta were friendly before the Persian War. They naturally joined the alliance which repelled the Persian invasion. A Spartan force helped Athens retain its government against a revolt pre-war. Athens post-war helped Sparta put down a serf rebellion, but then started to side with the serfs, so the Spartans sent them home. That was the split.
It was part of a coalition led by Sparta which repelled an invasion by the Persian Empire.
Persian Wars
The Peloponnesian War was between Athens and Sparta. It was after the great Persian war, when Athens and Sparta worked together to defeat Persia. The Peloponnesian War was started because Sparta feared Athens may dominate them one day. There was a big battle between them, lasting for many years, but in the end, Sparta won.
Sparta ***** The persian empire.
They both fought in the second Persian War
Persian Empire
There were over 200, led at first by Sparta, then Athens.