A marathon is a very long race that runners compete in — a 26 mile, 385 yard race, to be exact. When you're training for a marathon, you'll gradually increase the distance of your daily runs.
The word marathon has ancient legendary roots: it comes from a long journey taken on foot by the Greek messenger Pheidippides, from the battlefields of Marathon to Athens in 490 BCE. As the story goes, he ran without stopping, announced to the citizens of Athens, "We have won," and promptly died. The marathon was one of the original Olympics events, and its difficulty inspired the figurative meaning of "any difficult undertaking."