It was the Athenian and Plataian armies, which defeated the inferior Persian infantry caught without its cavalry support.
In the early stages from 499 BCE when Persia dominated, they were able to use Greek inter-city rivalries and disunity, ease of bribing their leaders, and in the field, the superiority of their cavalry and the fleets, which latter they levied from Phoenecia, Egypt and the Ionian Greeks as well. As the Greeks gained more cohesion and the will to combine for their common defence, they were able to consistently defeat the Persians on sea and land, until Persia agreed to peace in 449 BCE.
The Battle of Marathon was a turning point during the first Persian invasion of Greece. The Persians vastly outnumbered the Greeks on the battlefield, but the Greeks were able to defeat them. The Greeks charged the Persian troops with a thin weaker line, while the Greeks' left and right flanks consisted of stronger troops who quickly surrounded the Persian troops and attacked them on both sides. It was a crushing defeat for the Persians, and the battle convinced the Greeks that while the Persian Empire had vast armies and archers, it was possible to defeat them.
No.
They adopted a superior strategy of first defeating the Persian navy, and cutting off their sea supply line. The Persians had to send half their army home for the winter, and the Greeks united the city-state armies to defeat the depleted Persian army.
Because the Persians didn't have patience and sent the horsemen in first and the strongest in the boat leaving their weakest variable to Greek attack. The Greeks won even though they were outnumbered, because of the general's mistake of not waiting for the Greeks to come to the Persian forces.
After destroying Persian sea power at the battle of Salamis, they were able to defeat their army, and so end the attempt by the Persians to incorporate the cities of mainland Greece into the Persian Empire.
By superior force, strategy and tactics.
The war went on for another 30 years until the Persians gave up trying to impose peace on the Greeks and left them to go back to their usual fighting each other.
The overall Greek strategy was to thwart the Persian advance at the narrow pass of Thermopylae using a Spartan/Thespian/Theban blocking force , while at sea the Athenian Admiral Themistocles was to prevent Persian naval forces from outflanking the Greek land contingent by making an amphibious landing behind the Spartan King Leonidas and the Greeks . Themistocles was able to defeat the Persians at the sea battle of Salamis and the Greeks were able to withstand the Persian infantry assaults only to be outflanked on the land because the traitor Ephialtes had shown the Persians a way of outflanking the Greeks by showing the Persians a way around the pass of Thermopylae .h
He never had a Navy that could stand up to and defeat the Royal Navy.
sparta,athens and other city states united against a common foe-the persians. were able to keep the persians from conquering the greeks.