Marathon is a very simple battle without a lot of room for tactical finesse, but for that same reason a good training battle.
Both sides charged forward, but for the Persians at least there was some manoeuvre - they tried to weaken the Hoplites with their light infantry swarm before they reached the main line and also tried to do move their small cavalry force to make a rear attack.
The few Greek light infantry were quickly overwelmed, but the massed Persian bowmen were largely ineffective inflicting just one effective hit on the whole line before the melee started. The Greeks pushed the Persian main line back, but for a while it held.
The Persian Cavalry managed to get in rear, turn around and obey orders to return to charge the left rear of the Greek line just as their Immortals at the other end of the line broke. But the quality difference was so great that the Hopites survived the rear attack. The Persian centre then broke and it was all over.