He had previously ran to ask the Spartans for help on the battle but they wouldn’t leave until after some festival or something.
So, he then ran to the battle, fought, then ran back to Athens to tell everyone because a ship had slipped past the battle on its way to Athens and if it got back before their army the enemy would just say they won and sack Athens.
The Guy is a machine.
His full adventure inspired the ultramarathon The spartathalon
I feel like Nick Offerman would be a good choice to play him in a movie.