Draupadi was in her previous life Nalayani, wife of the ascetic Maudgalya.
One day he granted her a favor. She asked that he should divide himself into five figures and enjoy the pleasure with her. Then he should become one again. Maudgalya granted her wish, but when he was one again, Nalayani was not satisfied. He cursed her for her sexual insatiability to become the wife of five men in next life.
After the curse she withdrew into the woods, went in asceticism on Shiva, with the intention of breaking the curse. When Shiva appeared to her, he gave her the favor of marrying five courageous and strong men. Desperately, she interjected that she had only asked for a husband. But Shiva said she had expressed a wish for a husband five times. The only thing Shiva was willing to allow the horrified was that she would become a virgin again after every meeting with one of her husbands.
Draupadi married the five Pandavas.