The Devi Mahatmya, a text embedded within the Markandeya Purana and one of the foundational scriptures of Shakta Hindu tradition, narrates that the buffalo demon Mahishasura had, through austerity, obtained a boon making him invincible to any god or man, and used this power to defeat the gods and seize control of the heavens. Unable to overcome him through their own individual or combined male divine power, the gods poured forth their collective energy, tejas, which coalesced into the goddess Durga, formed specifically and exclusively to accomplish what none of the male gods, bound by the precise terms of Mahishasura's boon, could achieve.
Durga, armed with weapons contributed by each of the major gods and mounted on a lion, engaged Mahishasura in an extended battle described in vivid and dramatic detail across the text, as the demon repeatedly changed form, from buffalo to lion to elephant to human and back, attempting to evade her, before Durga finally killed him in his buffalo form, restoring cosmic and heavenly order.
The narrative is understood within Shakta tradition as making an explicit theological point: that ultimate divine power, Shakti, is fundamentally feminine, and that certain cosmic threats can be overcome only through this specifically feminine divine power, which the male gods, however powerful individually, cannot substitute for or replace.