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.