How did the Persian Wars help bring Greeks together?

The Persian invasion of mainland Greece caused a pause in the usual fighting between the Greek city-states. Some of the northern cities joined with Persia, while the southern ones banded together to oppose the invasion. When the invasion was turned back and Persia eventually agreed to stay away from the Greek cities, they went back to their usual business of fighting each other until Macedonia brought them under control.

At the Battle of Thermopylae, this was proven when over 7,000 Greek hoplites, led by King Leonidas of Sparta and 300 Spartans, defended the tiny pass from an invasion force of what might have been over 3,000,000 Persian troops, led by King Xerxes. The Persians might've not have as many casualties as it did if its navy could get past one obstacle: the Athenian Navy, led by Themistocles. Even though the rest of the Greeks retreated, the Spartans held their ground with about 1,000 other Thespians against the Persian ground troops. They were surrounded, and ultimately defeated. But this battle showed that all Greeks could fight together as not a bunch of city-states, but one whole country instead.