The story of Ganesha's birth is quite fascinating... even more so are the deep spiritual truths embedded in the heart of the story.
We may know Ganesha to be the remover of obstacles... and this is true. However, if we're headed toward a cliff, Ganesha will benevolently place obstructions along our path to protect and redirect us.
Still, He's much more than the Lord of Obstacles. He's the son of the Devi Herself... created to protect Her inner sanctum.
According to Amritapuri.com (dedicated to my beloved SatGuru, Amma) the story goes like this:
The birth of Ganesha
One day Goddess Parvati was at home on Mt.Kailash preparing for a bath. As she didn’t want to be disturbed, she told Nandi, her husband Shiva’s Bull, to guard the door and let no one pass. Nandi faithfully took his post, intending to carry out Parvati’s wishes. But, when Shiva came home and naturally wanted to come inside, Nandi had to let him pass, being loyal first to Shiva. Parvati was angry at this slight, but even more than this, at the fact that she had no one as loyal to Herself as Nandi was to Shiva. So, taking the turmeric paste (for bathing) from her body and breathing life into it, she created Ganesha, declaring him to be her own loyal son.
The next time Parvati wished to bathe, she posted Ganesha on guard duty at the door. In due course, Shiva came home, only to find this strange boy telling him he couldn’t enter his own house! Furious, Shiva ordered his army to destroy the boy, but they all failed! Such power did Ganesha possess, being the son of Devi Herself!
This surprised Shiva. Seeing that this was no ordinary boy, the usually peaceful Shiva decided he would have to fight him, and in his divine fury severed Ganesha’s head, killing him instantly. When Parvati learned of this, she was so enraged and insulted that she decided to destroy the entire Creation! Lord Brahma, being the Creator, naturally had his issues with this, and pleaded that she reconsider her drastic plan. She said she would, but only if two conditions were met: one, that Ganesha be brought back to life, and two, that he be forever worshipped before all the other gods.
Shiva, having cooled down by this time, and realizing his mistake, agreed to Parvati’s conditions. He sent Brahma out with orders to bring back the head of the first creature he crosses that is laying with its head facing North. Brahma soon returned with the head of a strong and powerful elephant, which Shiva placed onto Ganesha’s body. Breathing new life into him, he declared Ganesha to be his own son as well, and gave him the status of being foremost among the gods, and leader of all the ganas (classes of beings), Ganapati. (https://www.amritapuri.org/3714/ganesha.aum)
So, what does all of this mean?
Parvati is an embodied form of Parashakti. She is Supreme Energy and the Devi Durga incarnate. It is Parvati who unsheathes Herself to reveal Durga (Who then manifests Kali) when Shumbha and Nishumbha needed to be dealt with. Alas, that's another beautiful story for another time.
Parvati resides in the Muladhara (root) Chakra as the Kundalini Shakti. According to tantric teachings, when we cleanse and purify ourselves, Consciousness comes... hence the unannounced arrival of Shiva occurred during Her bathing ritual.
Nandi embodies devotion and a mind set upon the Divine. This is why he immediately recognizes Shiva and allows Him access to Her innermost chambers. According to Amma, "This shows that the attitude of the spiritual aspirant is what gains access to Devi’s (the kundalini shakti’s) abode. One must first develop this attitude of the devotee before hoping to become qualified for the highest treasure of spiritual attainment, which Devi alone grants."
Once Nandi permitted the entrance of Shiva, Parvati decided She needed Her own devotee, one who would place Her wishes above all else, including those of Her Divine consort, Shiva. So, taking the dirt from Her own holy body and turmeric paste (which is yellow, the color representing the muladhara and earth element in accordance to tantric texts); She created not a servant, but a child... Her own child born of Her own body and of the earth.
Ganesha is the Guardian of the muladhara chakra, where Devi resides. He is earthbound awareness, protecting Divine Secrets from minds that are not ready to receive this sacred awareness.
Shiva is Supreme Consciousness and Teacher... MahaGuru. Initially, Ganesha represents the ego bound Jiva... our souls as bound to material existence, lost under the veil of Maya. Surrounded by the haze of ego, He was unable to recognize Divine Consciousness and even fought with Him! How often we do the same thing... we fail to recognize the Divinity within ourSelves, and fight with it whenever it makes itSelf known.
Ego is powerful, and Shiva had to enlist His army (teachings) to fight. How often we learn what to do and don't have the willpower to follow through for reasons associated with ego. Not even they could defeat this headstrong child... and how very childish our ego can be.
So, what to do? MahaGuru had to eliminate the ego and cut the head off of this little tyrant denying Him access to His Beloved. (Severed heads are symbolically used often in the retellings of Hindu wisdom stories... this is why Maa Kali holds one below Her bloodied sword in many depictions!)
Amritapuri continues: "Devi threatened to destroy the whole Creation after learning of Ganesha’s demise. This indicates that when the ego thus dies, the liberated Jiva loses interest in its temporary physical vehicle, the body, and begins to merge into the Supreme. The physical world is here represented by Devi. This impermanent and changeable creation is a form of Devi, to which this body belongs; the unchanging Absolute is Shiva, to which belongs the Soul. When the ego dies, the external world, which depends on the ego for its existence, disappears along with it. It is said that if we want to know the secrets of this world, which is a manifestation of Devi, then we must first receive the blessings of Ganesha."
Shiva replacing Ganesha's head with that of an elephant has many meanings. Elephants are associated with wisdom... and here, that wisdom is Divine Realization of the Self. Only when we surrender our egos to the Divine, whatever form it may take for us, can we exist in this world unbounded... and become a guardian not only for our own inner sanctuary, but also for those who are still in the process of ripening.
Jai Ganesha! Jai Shiva! Jai Maa! Jai Gurudev!
Hungry for more? Check out this article: https://www.vedanet.com/the-hidden-truth-behind-sri-ganeshas-mystic-image/