The name Mahakal is derived from this legend. According to the legend Sati, Daksha’s daughter jumped in to the Yagna fire when her father refused to marry her to Lord Shiva. Lord Shiva when he came to know the incident got angry and started Tandav, the death dance to destroy the universe. This form of Lord Shiva is known as Mahakal.
One more reason for Lord Shiva being called Mahakal is the story of a Brahmin and his four sons, all devoted followers of Lord Shiva. One day when they were doing penance, they were attacked by demon named Dushan.
As soon as Dushan got ready to attack the Brahmin’s sons, the earth broke open and Lord Shiva appeared before Dushan in a huge form as Mahakal and burnt Dushan to ashes. Then the people of Ujjain requested Lord Shiva to stay back as Mahakaleshwar lingam.