Pandora's box and idiom and so on all come from an ancient Greek legend.
Prometeus and Epimeteus were two brother half-gods; the first had the skill of foresight (his name means "the one who knows before"), while the second was actually a bit stupid and vaguely understood things only later after they were happened (his name means "the ones who knows after"). Prometeus protected humans and had given them fire, so that they could develop their society, cheating Ephestus/Volcano (the god of fire) and – what's most serious – the supreme god Zeus/Jupiter. To get revenged of him and the whole human kind, Zeus ordered the goddesses to create a woman so much beautiful and charming as much curious and silly; she was named Pandora ("all made of gifts") and she was given a ceramics closed box containing all humans cares, pains, worries, sorrows, calamities and so on. Then she was sent to Epimeteus, who immediately fell in love with her and took her as his wife. Now imagine a curious silly woman with a mysterious closed box and only stupid Epimeteus to look after her. Obviously after some days she opened the box, and suddenly all the calamities inside came out and quickly invaded the world of humans... luckily clever Prometeus had felt such a trick and came just in time to close the box and leave the hope alone in.
The conclusion has been differently interpreted through times: some say it means humans got all calamities and were deprived of hope, other say hope is the only thing humans conserved.