The mantras ham and tham of hatha yoga are related to the hatha yogic process, not to the awakening of ajna chakra. Ham and ksham are the mantras for ajna chakra.
It is said in the science of vibration by Abhinav Gupta of the Kashmir Shaivite tradition that every sound, every word, every consonant, every vowel is known as akshara. Akshara means something which does not decay, which does not die.
What is that? It is the first evolute in space, sound or shabda. Shabda was also the evolute during the Big Bang. Without the shabda, the Bang would not have come into existence. Without the shabda, without the creation of vibrations which spread in all directions, the Bang would not have happened. Shabda is the first evolute in space, in science and in spiritual traditions.
This shabda creates tarang, waves, when a stone is thrown in the middle of a pond, from the point where the stone falls, one will see round ripples spread in all directions homogenously, simultaneously. That is the spandan, vibration, of the shabda. Shabda was the rock, something which fell, something which was uttered, something which one was able to utter, and from there sound creates the vibration, spandan.
In Sanskrit these spandans are categorized as dental, lingual or palatal according to where the sound is created.
If there is a dental sound in a mantra, the effect of the mantra will be in a certain way. If there is guttural sound in a mantra, the effect of the mantra will be different. If there is a lingual sound in the mantra, the effect of the mantra will again be different. From each category, a different set of vibrations is being generated. That is known as spandan. In the image of a chakra, one will find the bija mantra, the primary category of the spandan, and the sub-mantras, representing a spectrum of vibrations which affect, stimulate, awaken and activate that particular region.
The word hatha and the mantras ham and ksham correspond to each other, but they are not the same. According to certain grammatical principles depending where the first or second consonant and the vowels are put, any letter can change its pronunciation. For example the word shatkone is pronounced also as khatkone. Both are correct.
Each mantra has two levels. One which helps one become the gross dimension, and another which stabilizes one in becoming the subtle dimension.
Tham is a hard mantra, it is a dynamic, strong mantra: tham tham tham tham tham. It is like a hammer banging a gong: bang bang bang, tham tham tham.
Hatha yoga indicates a process of physical transcendence, coming to ajna chakra, however, it is still the process of physical transcendence. In the mantra hatha, one is dealing with the chakras from mooladhara to vishuddhi. The moment one reaches ajna chakra, tham changes into ksham.
This is the difference: banging one gong with a hammer, creating the bang is tham, and dropping one drop of water on a hot plate is ksham.
The mantra ksham is now the mantra of ajna chakra, it is no longer tham. Tham is the journey from mooladhara to ajna, indicating that the process of hatha yoga leads one to ajna chakra. Ham and tham do not mean that they are the mantras of ajna chakra. The mantra of ajna chakra is ksham, the drop falling on the hot plate and just going poof!
That is the subtle aspect for from here, ida, pingala and sushumna go as one. They merge and become one. There is no distinction, there is no duality. Therefore, the mantra for ajna chakra is ksham in the subtle body, in the subtle dimension. Whereas the mantra for hatha yoga is tham in the physical gross dimension.
—28 February 2016, Ganga Darshan, Munger