The Persians wanted to take over Athens so they sailed all the way to Athens bringing 15000 and the Athenians who only brought 10000 soldiers to defend their city.
When the battle almost ended
The two armies meet but they stand their ground because none of the armies wanted to attack each other knowing that both armies are strong smart so they do not dare to attack
When the persians fled
The messenger runs to Sparta and asks for reinforcements for the battle against the Persians but the Sparta Empire said they would not fight until there is a full moon and there wasn't a full moon that day. So the messenger ran back to the Athenian army and announced the message.
When the Persians were defeated and when the battle ended
The Athens who has 10000 soldiers beat the Persian army who has 15000 soldiers in their army and only 192 Athenians have been killed and 6400 Persian soldiers died on the battlefield. The Persians fled away and they decided to raid Athens from a different direction.
The remaining Persians fled and they decided they would attack Athens from a different direction. So they went back on their boats and pretended to flee but some of the ships got destroyed before they got the chance to flee and only some got away.
When the Persians came back, Sparta joined forces with Athens and finally defeated the Persians from letting them conquering Athens.