The legend of Mahakaleshwar relies on a variety of theories and myths; they're a number of the acquainted tales. It's believed that when Sati walked into the fire to rebel against her father, Daksha's objection to her marriage with Shiva, the latter was furious and so done the Dance of Death; the Tandav. He was then known as the Mahakal, or even t