Hercules is Zeus and Hera's son. Hera was a mortal and when Hercules was born she was jealous that he was half mortal. For he had strength like no other. So she tried to kill him in all types of ways with the help of Eurystheus, a jealous cousin of Hercules.
Zeus knew that letting him stay with the gods would end up in Hercules dying. Instead, he gave Hercules to a mortal family on earth to take care of him there. Hercules did not fit in with the others do one day his adoptive family told him he was a god. Soon he started his journey back to the heavens.
He planned to ask the Oracle of deHera and Eurystheus made a plan to give him 12 horrendus labors and they told him if he completed all of the labors he would be immortal. He planned to ask the Oracle of Delphi if it was a smart thing to do.
Hercules asked the oracle of Delphi and she said if you complete the 12 labors you would earn your immortality.
So, as hard as the tasks were he complketed all twelve and showed everyone that hard work pays off.