As the Devi Mahatmya tells it
Devi Mahatmya, Markandeya Purana 85 to 91 · 3 min read
Long ago two demon brothers, Shumbha and Nishumbha, drove the gods out of heaven and took everything that was theirs: Indra's power, the sun's light, the moon's, the wind's, the fire's. The gods went to the Himalaya and remembered the Goddess, who had promised to come whenever they called. They sang to her there. "To the Goddess who lives in every creature as power, as hunger, as sleep, as mercy, as mother," they sang, "we bow, we bow, we bow again."
Just then Parvati came down to bathe in the Ganga. "Whom are you praising?" she asked them. And out of her own body came another goddess, beautiful and calm, who answered for the gods: "They are praising me." Because she came from Parvati's body, from her sheath, she was called Kaushiki. Parvati herself turned dark and went away as Kalika.
Two servants of Shumbha saw the Goddess sitting on the mountain, and ran to their master. "There is a woman in the Himalaya," they said, "more beautiful than anyone in the three worlds. You have every jewel there is. You should have this jewel too."
So Shumbha sent a messenger called Sugriva. He bowed to the Goddess and spoke sweetly. "Shumbha rules the three worlds," he said, "and every treasure of the gods is in his house. He and his brother ask you to choose one of them for a husband."
The Goddess smiled. "That is all true," she said. "But in my foolishness I once made a vow. Whoever beats me in battle, whoever takes away my pride, whoever is my equal in strength, that one will be my husband. Let Shumbha come, or Nishumbha, and win me, and marry me."
"You are proud," said the messenger. "No god has ever stood before them. Will a woman? Come quietly, or you will be dragged by the hair."
"It is as you say," she answered. "But what can I do? I made the vow without thinking. Go and tell your king."
Shumbha was furious, and sent his general Dhumralochana with sixty thousand demons to drag her back. The Goddess made a single sound, "Hum", and he burned to ash, and her lion ate his army. Then came Chanda and Munda, and Kali sprang from her forehead and killed them. Then Raktabija, whose every drop of blood became a new demon, and Kali drank his blood before it could touch the ground. The powers of all the gods came out of them as goddesses, the Mothers, and fought beside her.
Then Nishumbha came himself, and fell. Shumbha saw his brother dead and his armies gone. "Do not be so proud, Durga," he shouted. "You are fighting with the strength of others."
"I am alone in the world," she said. "Who else is there besides me? Look, wicked one. These are only my own powers, going back into me."
And all the goddesses, the Mothers and Kali with them, went back into her body, until she stood alone.
They fought on the ground and then in the sky, with no support beneath them, a fight that amazed the gods. At last she threw him down and pierced him through the chest with her spear, and he fell, and the earth shook. Then the rivers ran in their courses again, the winds blew softly, the sun shone clear, and the gods sang to her once more.