This battle can be traced to Odin’s mischief.
Odin was riding through Jotunheim (the land of giants) and happened upon Hrungnir the giant, who was taken aback by this man riding a swift, flying horse (the eight-legged Slepnir). Odin bragged that his horse could outrace any horse in Jotunheim, which of course insulted Hrungnir. He mounted his own horse named Gullfaxi, or Golden Mane, and the race was on.
Odin won, of course, and led the giant straight into the gates of Asgard. The gods were amused by Hrungnir and treated him to drinks and merriment. But Hrungnir grew belligerent. As the gods grew tired of Hrungnir’s increasingly poor mood, they sent for their champion, Thor. Before Thor the thunderer could strike him down, Hrungnir challenged Thor to a duel to improve his odds of survival.
The giant arrived on the battlefield in stone armor, with a stone shield, and with a whetstone for a weapon. But mighty Thor made a spectacular entrance, wielding his hammer Mjõlnir and drawing upon his great thunder and lightning.
Each threw their weapon at the same time. Hrungnir died instantly. Thor was struck on the head; the whetstone shattered into countless pieces. The destruction of the whetstone is the strike from which all flint was created.
But a shard of the stone stuck in Thor’s forehead; he attempted to get it removed, but in encouraging the sorceress Groa, her spells failed and the shard stuck with him until his battle with Jormungand at Ragnarõk.
(adapted from Skáldskaparmál and the retelling at norse-mythology.org)