The image of the buffalo-slaying lion-riding Durga starts appearing in Hindu mythology only in the post-Gupta period, around 1,500 years ago. Amongst the earliest images we know today are one from Ajanta and Ellora caves in Maharashtra, and from Mamallapuram dated before the 7th century. Earlier icons have been traced to the Guntur district of Andhra Pradesh. After this, the goddess becomes a popular icon in Hindu temples, so much so, that it is hard to believe that there was once a Hinduism without the story of Mahishasuramardini, the buffalo-slaying goddess.
The Goddess has been worshipped from the Vedic times. In the Rig Veda, we do have the Devi Suktam that speaks of the ‘power’ behind all deities. However, there is no reference to Durga. The word durga in Veda refers to fortress only, or a place that is difficult to approach. The most popular goddess in Vedic times seems to be Shri, the goddess of fortune, venerated by Buddhists and Jains too. She is described as the daughter of asuras and beloved of devas, who is fickle, as fortune is supposed to be. Associated with lotus flowers and elephants and pots, there is nothing violent about her.
It is in the Ramayana and Mahabharata, composed before the Puranas, we learn of Ram and Pandavas seeking the support of a martial goddess, Durga, the goddess of kings. She is linked to weapons but we do not ‘see’ her. In the Harivamsa (appendix of the Mahabharata), we learn of Kalaratri, or Nidra, or Yogamaya, who guards the world when Vishnu is sleeping, and who ensures the safe birth of Krishna on earth, taking the form of a baby girl who slips out of Kamsa’s hand and foretells his death, terrifying him with her laughter. This is the proto-Durga coming from Vaishnava lore. In the epics also, we learn for the first time how the stoic otherworldly Shiva marries the Goddess, who turns him into a family man. But she is not connected overtly to Durga.