Greek tragedies were almost always based on well-known stories, so that just by hearing the names of the characters, the audience would already know a good deal about the play they were about to see. The story of Jason's adventures with the Argonauts was one of the most well-known myths of ancient Greece, even though it was not written as an epic until centuries after Euripides, in the Argonautica of Apollonius of Rhodes.
The tale is set two generations before the Trojan War, the setting of Homer's Iliad and the most famous epic of ancient Greece. Jason was a prince and rightful heir to the kingdom of Iolcus, but he was raised in ignorance of his royal roots and had to battle with his uncle Pelias, who had seized the throne. Pelias sent Jason on a quest to recapture the Golden Fleece, a solid gold sheep skin from a mythical golden ram. The Fleece was in the faraway kingdom of Colchis, a barbarian land on the Black Sea. To reach this distant land, Jason was aided by his patron goddesses Hera, the queen of the gods, and Athena, goddess of wisdom and crafts, who helped Jason build the first ship, the Argo.
Jason assembled a group of heroes from all over Greece to sail with him in the Argo. The Argonauts (which combines the name of the ship with the Greek word for “sailor”) included Heracles, the greatest hero of Greece, and Castor and Pollux, the sons of Zeus and brother of Helen of Troy. They had many adventures on their way there; the most perilous was the voyage through the Symplegades. At the entrance to the Black Sea (the modern Dardanelles in Turkey), according to this myth, there were two rocks which crashed together whenever anything passed through them. Athena, however, helped the Argo to sail through, and the rocks never crashed together again, thus opening the Black Sea and the barbarian lands beyond to the Greeks.
Upon arrival in Colchis, the king assigned a number of tasks to Jason, such as yoking fire-breathing bulls and sowing a field with dragon's teeth, which instantly grew into armed and angry soldiers. Jason was at a loss, until the king's daughter, the skilled witch Medea, fell in love with him and came to his aid.
Medea then helped Jason to lure the Golden Fleece from the dragon who guarded it; in most versions, she drugged the dragon so that it fell asleep. In order to escape from Colchis, Medea murdered her brother and chopped his body to pieces, which she scattered from the Argo. Because a corpse had to be buried for that soul to find peace in the afterlife, Medea's father gave up the pursuit of Jason so that he could gather the parts of his son and bury them. Medea fled with Jason and married him.
Even though Jason brought the Golden Fleece back to Iolcus, Pelias refused to give him the kingship. Medea used her witchcraft to trick Pelias’ daughters. She cut up an old ram, threw it into her cauldron, and produced a living lamb in its place. She told Pelias’ daughters that they could rejuvenate their old father in the same way, but, of course, all they did was butcher and boil him. Forced to flee Iolcus, Jason, Medea, and their children eventually came to Corinth, which is where Euripides’ play takes place.
As for the events that occur at the end of the play, there actually was a ritual in Corinth relating to the murdered children of Medea, though the standard explanation was that the Corinthians had murdered them in revenge after Medea killed the king and princess. It makes much more sense for the Corinthians to perform rituals to rid themselves of their own guilt—one reason why scholars suspect that Medea's murder of the children herself is a Euripidean invention, with these instructions by the now semi-divine woman as an explanation to link the two stories together.