Drupada, the king of Panhala, organized a competition where the challenge was to string a bow and hit a target, then they would choose the winner to marry his daughter Draupadi. Arjuna was victorious and garlanded by Draupadi. The Pandavas returned with her to their mother Kunti, who, even before she saw them, asked them to share whatever they had got. She realized her mistake when she saw Draupadi, but they could not violate her command.
After much deliberation, Yudhishthira decided Draupadi would be their common wife. When Drupada was told about this, he protested. However, the seer Vyasa arrived and told him that the Pandavas were in reality incarnations of Indra, whose wife had been reborn as Draupadi, and it predetermined them for each other.
Vyasa added that in another instance a young woman had prayed to Shiva for a husband, and in her enthusiasm. Had prayed five times instead of once. This woman was now reborn as Draupadi, and Shiva had fulfilled her prayers. Convinced by these stories, Drupada consented to the marriage.