The basis of Purim is the story of Queen Esther, recorded in the megillah, also known as the Book of Esther. Esther is an orphan, raised by her uncle Mordechai, ultimately plucked from obscurity to be the queen of Persia by the drunken King Ahasverosh. Her story involves secrecy, intrigue, violence, an evil villain, sex, and ultimately, a raucous celebration.
Intrigued? You can read the whole Purim story here.