The incident that led to Lord Ganesha having Elephant head is as below: Lord Shiva goes out of his abode, called Kailasa. Parvati Mata stays at home and being alone creates a idol and gives it life. This was the original Ganesha and he is given a full power of a normal person. When Parvati mata goes to take bath, Ganesha sits outside and watches that noone enters the home. At that time, Lord Shiva also doesnot know that this baby is the kid of Parvati mata and tus his own. Ganesha also at that point doesnot know that Lord Shiva is the husband of Parvati Mata. Lord Shiva tries to enter his wifes room ut Ganesha objects and a friction occurs, which angers Lord Shiva and severs the head of Ganesha. But when Parvati mata comes out after a while, she tells everythig and asks life of Ganesha back. Lord shiva at that tie also realizes that one of his devotee, an elephant, is seeking his solace and he then sends his people to get its head and then gives Ganesha life. This way, he satisfies 2 people, one is his own wife and the other is his devotee, an Elephant, and thus Ganesha will end up having elephant head. But for this Lord Shiva accords Lord Ganesha the infinite knowledge and other powers and even gives control over the life forces like negative or positive forces of life. Since Lord Ganesha is the controller of some life forces, this is the reason why Hindus pray to Lord Ganesha to remove any unwanted negatvie forces acting subtly against them before starting an event e.t.c