In the Vedic scriptures, one would find deities with many names. Those names are not their birth names but given according to the qualities or heroic acts they perform.
For example, Lord Krishna is called Madhusudana because He killed a demon named Madhu.
He is also known as Narayana because He is the shelter (Ayana) of all the beings (nara).
Similarly, Lord Shiva is known by many names like Aashutosh, Bhairav, Bholenath, Girijapati and the like. Of these names, Mahadeva is the most prominent and celebrated one.
It means He is the Lord of all devas and danavas. He is the controller of other controllers.
Lord Shiva in His absolute Brahman (unmanifested form) sustains all energies of the cosmos.
In the spiritual world, Lord Vishnu represents the Dharma principles, Lord Brahma represents the creative force and Shiva epitomizes Soul, the founding element that sustains matter in the material world that comprises billions of galaxies.
In the Puranic scriptures, it is said that when Lord Brahma and Lord Vishnu argued over who the supreme leader of all that exists is, Lord Shiva emerged as a beam of Divine Light as luminous and bright as thousand suns.
When asked by Shiva to find the beginning and the end of the Light, Brahma and Vishnu made several attempts to find out but failing at it accepted the position of Shiva.
This beam was later assumed the divine, magnificent form of Linga (Shivalinga).
In the Vaishnava Vedic scripture called Srimat Bhagavatam (Bhagvat Purana), Shiva glories.
When Daksha, father of Sati and father-in-law of Shiva, insulted and cursed Lord Shiva who did not rise as a mark of respect in the arena of a thousand-year Yagya (sacrifice), Shiva silently put up with the humiliating statements and abuses.
Later, Lord Brahma appointed Daksha to act as the chief of all the Prajapatis, the progenitors of the population in universes of the Cosmos.
Because of holding this higher post, Daksha turned arrogant and very much puffed up.
He conducted one more Yagya wherein he did not deliberately invite Lord Shiva. Sati, ignoring Shiva’s warning, was insulted by her father during the Yagya.
This made her take an unexpected decision; she quit her body by jumping into the fire.
When Shiva heard this, He immediately accompanied by followers (ghosts) launched a series of attacks the entire arena and the demigods. Extremely frightened, the demigods asked Lord Brahma for help.
It is given in the verse 4.4.6 of the Bhagvat Purana:
अशासना जीवितमध्वरस्य लोकः सपालः कुपिते न यस्मिन।
तमाशु देवं प्रियया विहीनं क्षमापयध्वं ह्रदि विद्धं दुरूक्तैः।
Ashasanaa Jivitam Adhvarasya
lokah sa-paalah kupite na yasmin
tam aashu devaṁ priyayaa vihinaṁ
kshamaapayadhvaṁ hṛdi viddhaṁ duruktaih
‘Lord Brahma also advised them that Lord Shiva is so powerful that by his anger all the planets and their chief controllers can be destroyed immediately.
Also, He said that Lord Shiva was especially sorry because he had recently lost his dear wife and was also very much afflicted by the unkind words of Daksha. Under the circumstances, Lord Brahma suggested, it would behove them to go at once and beg his pardon.’
This verse proves that Lord Shiva is aptly called Mahadeva because he is so powerful that the entire cosmic system can be burned to ashes by Him.
And this is done by His dance in the mood of Rudra. That dance is called Tandava. When He performs it, no god or demon can stop Him. If Shiva is the most merciful, then He is the most unforgiving (to evil forces).