Dido was said to have founded Carthage on the coast of Africa according to Greek mythology. She was also the queen of Carthage. Dido's father, Belus, wanted Dido and her brother Pygmalion to share his throne together and equally upon his death, but Pygmalion was greedy and took the throne for himself. He murdered Dido's husband, so she and her followers from Tyre (where her father had been king), fled, eventually landing in North Africa. There, they built Carthage, and Dido became the queen.
Later, a man named Iarbas wanted to marry Dido, but she had sworn never to marry again after the death of her husband. Iarbas refused to take no for an answer and threatened war if she would not marry him. Rather than go back on her vow, Dido threw herself onto a funeral pyre, killing herself. In another version of the story, Dido stabs herself to death on the pyre in front of her people.
Virgil's account in his epic poem, The Aeneid, has Dido falling in love with the hero Aeneas, and when Dido finds out Aeneas plans to leave, she stabs herself to death with a sword given to her by Aeneas. This is from where the willow comes. A willow represents the mourning of the loss of a lover, so Dido carries one because of her loss of Aeneas.