Brahma tried to awaken Lord Vishnu by shaking the stalk of the lotus he was sitting on, but in vain. He then realized that the sleep that had settled on Vishnu’s eyes was the Great Goddess in her form of Mahamaya, an expression of the divine mother’s power of delusion. Brahma then worshipped her with an inspiring hymn of praise, asking her to release Vishnu from his slumber. The ever-compassionate goddess obliged.
Awakening, Vishnu held Madhu Kaitabh and engaged them in a combat, which went on for five thousand years. The two demons then puffed up with pride, thinking themselves invincible. It was at this moment that the great goddess struck at the duo with her maya, making them vain enough to say to Lord Vishnu himself:
"We are pleased with your power and strength. Go ahead and ask for a boon."
Vishnu immediately seized the opportunity and asked for the boon that they be slain by him then and there. Indeed, one should always watch out for those moments of pride, which are the opportune instances for maya to delude us.
Thus cornered, the duo realized their folly; but seeing water everywhere, were wise enough to ask that they be killed only in a dry place. Vishnu then sat down in the water itself. However, like the auspicious lotus remains untouched by the water it grows in, similarly did Vishnu’s lotus like body remain untainted. He then proceeded to place both of them on either thigh, and cut off their heads.
Madhu actually means honey and he represents attachment (raag) to this world, which seems sweet to us. Kaitabh means a pricking thorn and signifies our aversion (dvesha) to things we deem as unpleasant. Both of these traits, which do much to make up our overall nature or temperament (prakriti or svabhav), is a residue carried over from numerous previous births. Both are products of maya and need to be annihilated.
In another interpretation, Madhu is honeyed praise, while Kaitabh is sour criticism, both of which enter through our ears, but are two side of the same mayic coin and need to be discarded. In either of the interpretations, the two demons attack our intelligence, symbolized by Brahma who is the patron deity of intellect. The Bhagavad Gita says:
"When your intellect, though perplexed by what you have heard, shall stand immovable and steady, then shall you attain self-realization". (2.53)
The goddess as restful sleep is an apt metaphor signifying her motherhood. When a mother sees her small child tired after playing in the fierce sun, she catches hold of him, feeds him and pats him to sleep, even against his own wishes, knowing very well that the sleep will restore his energy. Indeed, while our whole day is spent in emptying our shakti, the compassionate goddess takes it on herself to continue replenishing it. So she puts Vishnu to rest, tired after the exhausting task of maintaining the universe, and when the next creative cycle begins, relieves him from his slumber.
However, we cannot win over the two demons of attachment/aversion or praise/criticism, relying solely on our own powers, like Lord Vishnu who was unable to defeat them even after many years of fierce battle. The only way to win over maya is to surrender ourselves to Mahamaya, the goddess who created it in the first place. The fact that the two demons asked to be killed in a dry spot is also loaded with spiritual symbolism. Both these pairs of traits can only be destroyed on the ground of Vairagya (disenchantment), which is the dry state of existence, devoid of all worldly rasa.