The King of Kashi (Divodas) was responsible for re-establishing the Law of Dharma on Earth.
1. Mankind was in the danger of not being able to endure the Law of Dharma. Every other Kingdom was destroyed on Planet Earth.
2. Hindu System has been divided into 4-parts, namely, Brahmana, Kshatriya, Vaishya and Shudra. Depending upon the nature of each part, the duties have been classified.
3. If the person is a Kshatriya, he would be a king and reign the Kingdom according to the law of Dharma. At that time, Dharma was not part of human nature anymore. The existence of Gods depended upon the deeds of humans.
4. So, Gods feared that if mankind would be destroyed, then their existence would come to an end as well. After some searching, they found that Divodas, the only King to endure Dharma, lives in the forest of bliss.
5. Gods asked Divodas to reign Kashi and re-establish the Earth on Law of Dharma. Divodas’ condition was that the Gods mus leave Kashi if they want the King to take up the throne of Kashi. Gods accepted it and left Kashi and went to the heavens.
6. With his powers, Divodas established the city and everyone had everything in the city of Kashi, establishing the Law of Dharma on Earth.
7. After many years, when Gods wished to come to Kashi, they could find no way to enter Kashi. They came in different forms to find a single fault of the King. Once they broke the agreement, the Gods entered the city.
8. Living a few years in the city, they were conditioned by the Law of Dharma. They then became residents of Kashi in the Divodas Kingdom. They forgot their virtue and followed Divodas.
9. Finally, Lord Ganesha came and made Divodas think that he had everything in Kashi, except, mental peace. Lord Ganesh told him that 10-days later, a saint will come, and calm him from his distractions.
10. 10-days later, Lord Vishnu came in the form of a saint and told Divodas about his greatness. Brahma also explained to him that in your Kingdom, only one deed, that is to ask Shiva to leave the city, has been cursing the city’s mental peace.
11. Vishnu tells the King that he can correct his mistake by making a Shiva Linga. Furthermore, he must worship Shiva to bring him back to Kashi. The King did the same, and Shiva returned to Kashi.