Ancient Greece was made up of City-States. The strongest of these were Athens and Sparta. The City-States came together to fight against the invading Persian army, not Arab.
The Spartans were not alone, there were about 700 Thespian warriors, guarding the rear. After many failed attempts, the Persians found a local guide. The guide showed the Persians a backdoor around the pass. They destroyed the thespian rear guard, and attacked the Spartans from behind.
http://en.wikipedia.org/wiki/Battle_of_Thermopylae