The Athenian naval force was part of a joint naval force from 30 city-states which defeated the Persian fleet at Salamis in 480 BCE.
The city was invested, which confined them to the city and rendering them unable to provide food by farming. They used their superior fleet to bring in food and to raid and threaten their opponents' home cities. The Peloponnesian League concentrated on destroying the fleet. This was eventually promoted by the Persians providing money to build a superior fleet, which defeated the Athenian fleet, isolating the city. They then rounded up the overseas Athenian garrisons and sent them back to the city to help eat the sparse food and accelerate surrender of the city.
The Athenians were not at the battle of Thermopylae, but were aboard their warships - hey had sent their families for sanctuary in Peloponnesian cities. The Persians took over Athens and used it as a base while the Greek fleet assembled at Salamis, where it where it met and defeated the Persian fleet.
Persia got back at Athens by giving the Peloponnesian League led by Sparta the money to buy and pay for the running of a war fleet comparable to that of the Athenians. The money allowed the Spartans to offer double pay to the crewmen, and so attract the best seamen.
They split their force. Their plan was to pin down at Marathon the Athenian infantry with their more numerical infantry, while their cavalry was shipped around to capture Athens in the absence of its army. The Athenian army would then be trapped in the open between the captured city walls and the infantry at Marathon.Their error was in imagining their infantry without its cavalry support could stand up to the Athenian infantry. The Athenian armoured infantry, when they realised their opportunity, rand down from the hills around Marathon and over-ran the weaker Persian infantry. The Persians aid the price for this mistake.The Athenian infantry then realised that the Persian cavalry was being shipped down the coast to Athens, so they ran the 26 miles over the hills back to Athens and arrived just in time to turn back the Persian cavalry when it was being disembarked. The Persians gave up and went home.
They destroyed their fleet at Salamis. As a result, the Persians had to send half their army back home as they could not be fed in the upcoming winter in such a poor country as Greece without the navy to protect the supply ships from Asia Minor.
It was 18,000 Athenian warriors who ran back after their successful battle at Marathon to protect Athens from assault by sea in their absence. They ran back when they realised that the Persian cavalry was heading to Athens on ships. They ran the 26 miles, arriving just as the Persian cavalry was disembarking to take the city. There is a fake story that Pheidippides ran back to tell of the Marathon victory. He was already dead, dying from exhaustion after running to Sparta to summon them to held repel the Persian invasion.
He persuaded the Persians to send a third of the fleet to cover the back entrance to the strait and so miss the battle. He put in the Persian mind the idea that part of the Greek fleet would defect to the Persians as had happened in Ionia nearly twenty years earlier. He induced the Persian fleet to sit all night at their oars so that they were tired for the battle the following day. He induced the Persian fleet to attack into the strait where they had to split into two colums to get around an island. The Greeks then descended on this badly reduced, split ad disorganised enemy.
In the strait between the island of Salamis and Attica, known as the Battle of Salamis, where the Persian fleet was defeated in 480 BCE. The following year in 479 BCE there was a land battle at Plataia where the army of the Persians and their Greek allies was defeated.
Their cavalry was not at the battle, which was whay they lost it. The cavalry was embarked, heading for Athens to capture it in the absence of the Athenian army. After defeating the inferior Persian infantry at Marathon, the Athenian infantry woke up to what was happening and ran the 26 miles back to Athens, getting there just as the Persians were disembarking, and formed up in front of the city. Traitors were going to open the gates to let the cavalry inn but were frustrated by this. The Persians, their plan gone, went home.
It relied on two major assets - the walls which protected the city and the link to the seaport, which allowed them to withstand a siege and import food. its war fleet which allowed them to harass opposing cities and protect supply ships.
He conned the Persians, getting them to believe: a. That he might defect to them, bringig the Athenian fleet with him, which caused them to delay and sit all night at the oars in a heavy sea and were exhusted the following morning at the battle. b. That the Greek fleet was going to flee Salamis and leave via the back strait, which caused the Persians to send a third of their fleet to seal it off and so miss the battle. c. He persuaded the Greek commander to fight in narrow waters to use the mobility of the lighter Greek ships and their rams against the more powerful but less manoeuverable Persian ships which wanted to close and board. (copied against the Spanish Armada in 1588 CE) d. He persuaded the Greek commander to catch the remaining Persian fleet from the flanks as it was split in two and strung out in line ahead passing around the island of Psyttalia at the entrance to the gulf. Not much courage there, plenty of savvy and cunning.
After the Battle of Marathon defeated the Persian infantry, the Athenian army ran home 26 miles over the hills back to their city to protect it from a Persian amphibious attack launched after the battle. The marathon runs today commemorate that run by 9,000 Athenian armored warriors and their 9,000 light infantry.