There are many legends associated with the origin of the festival of lights. The fesitval is dedicated to various gods and goddesse. The basic ideology behid the celebration is the abundance of autumn harvest. The other legends associated with the deepavali festival is given below:
The Legends of Diwali
Goddess Lakshmi : It is said that during the churning of the ocean (samudra-manthan), Lakshmi, the Goddess of wealth, was incarnated on the new moon day (amaavasyaa) of the Kartik month. Hence the association of Diwali with Goddess Lakshmi.
Vishnu Rescued Lakshmi: On this very day, Lord Vishnu rescued Lakshmi from the prison of King Bali. Lord Vishnu was in his fifth incarnation as Vaman-avtaara. This is another reason of worshipping Ma Larkshmi on Diwali.
Lakshmi, Kali and Saraswati:Diwali also celebrates the gracious nature of the three goddesses. Dhanteras (two days before Diwali) is dedicated to Lakshmi. Her blessings are essential for a prosperous life. Kali-Chudash (the day before Diwali) is dedicated to Maha Kali. We seek Her strength, physical, mental and spiritual to maintain the wealth we have to lead a happy life. Diwali is also dedicated to goddess Saraswati. Knowledge is the ultimate wealth as it cannot be taken away from you and it often defeats brute force.
Krishna Killed Narakaasur: On the day before Diwali, Lord Krishna killed the demon king Narakaasur. He rescued 16,000 women from his prison. The celebration of this freedom went on for two days including the Diwali day as a victory festival.
The Return of the Pandavas: According to the great epic 'Mahabharata', when the Pandavas appeared from their 12 years of banishment, it was 'Kartik Amavashya' . The subjects who loved the Pandavas celebrated the day by lighting the earthen lamps.
The Victory of Rama: According to the epic 'Ramayana', it was the new moon day of Kartik when Lord Ram, Ma Sita and Lakshman returned to Ayodhya after conquering Lanka and defeating Ravana. The citizens of Ayodhya decorated the entire city with the earthen lamps and brightened it like never before. The darkest night of the year was transformed to a glorious morning as Rama returned to his ancestral kingdom of Ayodhya.