Maui had extinguished all the fires of the land. So he volunteered to go to Mahuika to ask her for fire.
He travels to the underworld to retrieve fire from the goddess of fire mahuika. She takes pity on Maui's situation and grants him the gift of fire and gives him one of her flame lit finger nails to take back to the over world.
After repeatedly extinguishing the fire from the fingernails, Mahuika eventually caught on to what Maui was doing and she lashed out, hurtling her last fingernail towards him at tremendous speed. It missed him and began to set fire to all of the land, Maui tried to turn into a fish but the water in the ocean was boiling like lava. Then the fire died down and everyone was okay :). Jk some people died probably.