There was far more than one Greek-Persian war.
Probably the best place to start is the Ionian Revolt of around 499 BC. It was morally supported by Athens, but it failed in around 494 BC. It pissed Persian Emperor Darius I off royally, and he began planning a punitive expedition.
In 492 BC Darius sent his fleet against Thrace and Macedon in preparation for an invasion of Greece–and particularly Athens. The expedition failed when a storm wrecked the Persian fleet.
Two years later, in 490, Darius tried again, going more-or-less directly to the bay at Marathon, only 26 miles and change from Athens. The Athenians asked the Spartans for help, but the Spartans were in the midst of an extended religious ceremony and would not arrive until after the battle. In the event, the Greek coalition led by the Athenians won anyway, and Sparta was somewhat embarassed at having missed out on the big day.
Darius returned home to plan an even larger invasion, but he died in 486 before he could complete the plans. Xerxes took over and in 480 he invaded Macedon (which was not exactly Greek territory) and forced it to surrender.
Then Xerxes outmaneuvered the Greeks through the use of intelligence, confronted and defeated Leonidas at Thermopylae (and partially cleaned the slate for the Spartan absence at Marathon), and captured and burned Athens, only to then walk into a strategic disaster in the naval battle of Salamis.
In 479, the Greek coalition did pull off two important victories at Plataea and Mycale. That effectively ended the Persian wars in mainland Greece.
Athens rebuilt itself and continued to harass the Persians through the coalition known as the Delian League while the Spartans went home. Within ten years, Athens had turned the League into its own empire. That in turn led directly to the Peloponnesian War between Athens and Sparta.
Thereafter, Persia got smart and started inserting itself into the various conflicts in order to fight its wars by proxy. Persia backed Athens and Corinth against Sparta in 395. By 387, Persia was giving naval aid to the Spartans.
Finally, in 337 BC, Phillip II of Macedon formed the Hellenic League which consisted of most of the Greek states except Sparta and… Thebes, maybe? One of the first things the League agreed upon was an invasion of Persia.
Why? One stated reason was to avenge the invasion of Xerxes 140+ years before, strong evidence that old grudges died hard in those days. It was Alexander the Great who would finish the job and finally destroy the Persian Empire in 330 BC.