There are two main accoints of the story and, ironically, he didn't actually manage anything useful in either of them
In the oldest one, he was sent from Athens to Sparta to ask for help against the invadng Persians. He ran 240 km in two days in this version of the story, only for the Spartans to say that actually they were busy with a religious festival and would not be coming to help. He then ran back. In this one he runs more than ten marathons in a matter of days and doesn't die, and while the Spartans didn't help someone did have to go ask to find that out
In the later one, he ran the 40 km from the battle of Marathon back to Athens to say "we won" and then die. Of course, there's not really any strategic decisions required from the information of "we won", so in this version he ran himself to death for basically no reason at all