The meaning of the Om Namah Shivaya mantra was explained by Satguru Sivaya Subramuniyaswami:
Om Namah Shivaya
This is the most holy name of God Śiva, recorded at the very center of the Vedas and elaborated in the Shaiva Agamas.
Na is the Lord's concealing grace, Ma is the world, Si stands for Śiva, Va is His revealing grace, Ya is the soul. The five elements, too, are embodied in this ancient formula for invocation. Na is earth, Ma is water, Si is fire, Va is air, and Ya is ether, or akasha. Many are its meanings.
Namah sivaya has such power, the mere intonation of these syllables reaps its own reward in salvaging the soul from bondages of the treacherous instinctive mind and the steel bands of a perfected externalized intellect.
Namah sivaya quells the instinct, cuts through the steel bands and turns this intellect within and on itself, to face itself and see its ignorance. Sages declare that mantra is life, that mantra is action, that mantra is love and that the repetition of mantra, japa, bursts forth wisdom from within. The holy Natchintanai proclaims, Namah sivaya is in truth both Agama and Veda.
Namah sivaya represents all mantras and tantras. Namah Sivaya is our souls, our bodies and possessions. Namah sivaya has become our sure protection.