I know that they were outnumbered one to three by the Persians, so how did they manage such a decisive victory?
Quite contrary to what people seem to think the Persian army under Darius was not some motley group of lightly armored infantry that relied on archery and cavalry and was unable to engage in frontal shock warfare. Far from it--in fact, the most important reason for the Persian successes against their enemies in Asia Minor and Egypt was the high discipline and excellent equipment of their infantry corps, a tradition that they inherited largely from the Medes, who in turn got it from the Assyrians. Xenophon at several points notes how well-armed and armored the Persians are, and notes that the troops pursuing the Ten Thousand were impeccably disciplined, although he's rather disparaging of the troops who directly faced the Greek wing at Cunaxa (he has nothing but praise for the troops on the other wing). The Persian army's backbone, until they encountered the Phalanx under Alexander, was their corps of heavy infantry, recruited from the best Median and Persian boys. Everyone seems to know about the Immortals, and although it's very uncertain just how long that corps was preserved l, especially under that name, it's known that Darius III relied on a central corps of infantry that strongly resembles Herodotus' Immortals. The Immortals were not a force of only 10,000. That was just the Persian Immortals. There was also a Median corps of Immortals, second only to the Persian Immortals and the select corps within them that made up the Great King's foot guard. Other satrapies contributed corps of Immortals or heavy infantry corps, according to their local specialties that could be levied. The inferior infantry were rarely intended to hold anything but to sit in reserve. Peter Green suggests that Darius III only continued to even field his Asiatic levies only due to tradition, since he clearly didn't trust them
Now that being said, why did the Athenians win? We actually don't know how many Persians there were low estimates usually estimate three to one, others estimate higher. Certainly the Athenians were heavily outnumbered in a time when warfare was decided almost entirely by weight of numbers. Now, much can be said about the superiority of Athenian discipline, tactics, and equipment but if you really want that stuff go read Snodgrass, who is the scholar that pretty much everyone who's written about that stuff since has been cribbing off of. Herodotus is quite clear about what happened at Marathon, and his account is generally considered to be one of his most accurate passages, apart from the estimates of the Persian army's size. Herodotus says that Miltiades' decision to attack was based on reports from his scouts and the Ionians who had been impressed into the Persian army, who came across the lines one night and spread the word to the pickets that the Persian cavalry was away. Where exactly were they? We have no idea. It's been theorized that maybe they were at fodder in the fields north of Marathon, or that Datis had loaded them onto the ships in preparation for a series of cavalry raids behind the Athenian line. What's certain is that the Persians were caught completely off guard. Herodotus says that the Athenians at Marathon were the first Greeks to charge the enemy at a run, which supposedly surprised the Persians and prevented their infantry, who generally carried bows along with their spears, to properly fire on the Athenians. I rather like imagining the Athenian attack, because the Athenians deployed their entire line almost immediately and ran them forward silently. Understand that nobody in the history of warfare had ever charged such heavily-armored infantry, without warcries, in a frontal assault. Moreover a Persian army had never been attacked by such a determined and well-armed force, which must have been a total shock to the Persians. Also, whether or not Miltiades' decision to thin his center was intentional, it was a tremendously innovative move, which allowed the heavy Athenian wings to crush their Persian counterparts and wrap around behind them, pushing them into the sea as Herodotus says.
Nevertheless, the victory was far from certain. Marathon is justly considered a miraculous victory, because not only did the Athenians defeat an undefeated army that had conquered the civilized world, but they did it at a loss of only 192 men while showing several very impressive innovations l. It really did shock the world
The main reason was the quality of troops. As shown in later years at the battles of Plataea, Thermopylae and Mycale as well as Alexander's campaigns Persian infantry was too lightly armoured and not trained well enough to be able to go toe to toe with phalanx from the front. Many of the Persians at Marathon were probably archers, that was the way most Eastern Militaries fought at the time and an archer armed solely with a bow and a dagger had no hope of defeating hoplites head on. The terrain was favourable to the Athenians, it was not wide enough for the numerically superior Persians to flank the Athenians nor long enough to give them ample space to properly skirmish with the Athenians. The elite arm of the Persians, their cavalry is not mentioned by Herodotus during his account of the battle, this may be because the were simply trapped by the terrain and unable to get around the Athenian line and charging head long into spear armed hoplites would have not been that effective, or because they were the units mounted on ships hoping to take advantage of the fact that Athens was undefended as it had sent all of it's hoplites to Marathon. Finally, the famous weak centre of the Athenians allowed them to flank and destroy the Persian centre in a brilliant tactical manoeuvre. In conclusion the main thing that aided the Athenians was the way the Persians had devolved their tactics for fighting in wide open plains of Iran while the Athenian fighting style was suited to the narrow passes and choke-points of mainland Greece.