Eve of celebration
Deepavali (diwali) is celebrated in the eve of victory of the good over the evil acts and ideals.
In this context it is the victory of Lord Krishna over the demon Narakasura.
Story of Naraka:
When Lord Vishnu was in the Varaha avatara he once was together with Bhumata in the evening time. Bhumata concieved in this situation.As it is a sin to be together in the Sandhya samaya (evening) Lord Vishnu said that a demon would be born .
Bhumata was sad about her child and prąyed Lord Vishnu to bless her child so that he could lead a great life. Lord Vishnu accepted but said that the child has to leave his life in the hands of his own mother.
Bhumata took the child to King Janaka and asked him to grow the child. Naraka was grown up there .After the child was grown Varaha swamy taught him how to be good and also told him to worship Kamaakhya Mata as his mother and left him in the same place. Naraka became the king and started to rule his kingdom from Kamakhya.
As he worshipped Maa kamaakhya he got great glory and he was energetic.
Banaasura a devotee of Lord Shiva, ruler of the near by kingdom Tejpur, became a friend of Naraka. Banasura seeded a thought in the Naraka that females should not be worshipped with Maatrubhava. Rather they should be seen with kama bhava.This thought made the mind of Naraka leave the worship of Maa Kamakhya and he started to bring all the princess all around the world and brought about 16,000 of them to his kingdom.
This was the situation when Lord Krishna declared a war against Naraka.Lord Krishna took his wife Satyabhama (who was the avatara of Bhumata in Dwapara yuga) to the battle.
In this context the importance of Ashwa Kranta temple in Kamakhya where Lord Krishna with his army had a halt.
He was clever that he pretended to be defeated by Naraka at a point of time in the battle. This caused Satyabhama to start war against Naraka. As she was the mother of the demon she could kíll him in the battle.It was then the demon recognized his mother in the last moments. Satyabhaama also came to know that she was kílling her child. She was convinced by Lord Krishna. The 16,000 princess under the hold of Naraka refused to go to their home with the fear of rejection.They asked Lord Krishna to marry them all as he was the saviour of their lives from the demon.
In this contest a mention about other avatara of Lord Vishnu as Naranaarayana in other time.During this avatara Lord Vishnu was requested by the 16,000 apsarasas sent by Indra to marry them as he gave them a boon.He said that he would accept their wish and marry them in his next avataara as it was not possible in the avatara of Narayana (a person in tapasya should follow brahmacharya).These 16,000 apsarasas were born as princess in dwaapara uga to fulfill their wish in their previous life.
This victory of Lord Krishna and the defeat of Naraka on the Aashviyuja bahula chaturdasi is celebrated as Naraka Chaturdasi and the next day celebrated as Depavali.