The structure of this mantra is based on the esoteric symbolism of numbers. The mantra of Shiva is composed of five letters (panchakshara in Sanskrit), namely: Na-mah Shi-va-ya. In religious practice and mythology, Shiva combines in himself five aspects of the universe. His eternal energy is conceived of as evident in five activities:
1) As Sadyojata, he enfolds the whole of creation.
2) As Vamadeva, he preserves it.
3) As Aghora, he reabsorbs or dissolves it.
4) As Tatpurusha, he veils or conceals the world of phenomena.
5) As Ishana, he grants boons and bestows on his devotees grace, which leads towards final liberation.
These five aspects are correlated with important and fundamental sets of five psycho-cosmic principles, such as the five elements, the five senses, and the five quarters (the four regents of space + zenith). This is also one of the reasons why the pentagon is associated with Shiva. The five syllables of Shiva's mantra are thus an attempt to illustrate his immanence in his five aspects.
Of Related Interest: