This useful ability comes from ages of practice with his highly developed vocal chords. Thor was a lot of fun at drunken feasts when he made embarrassing noises emit from under Heimdall or had Hogun's voice say to a Valkyrie, "Hey baby, looking good in that armor."
It's funny how I would be annoyed if a writer or artist just gave a character new super-powers without warning every few pages, but Jack Kirby did it all the time and it didn't bother me. Thor seemed to pull new powers out of his winged helmet in every story, but somehow it was okay when Kirby did it (maybe because his art had such conviction).
The usual rule of fantasy or sci-fi storytelling is that you explained exactly what your hero could do and demonstrated those powers early in the story. This is just playing fair with the reader. If your hero is caught in a death trap but just says out of nowhere, 'lucky I have my Molecular Scrambler on me, I'll just phase through the wall ha ha,' there's no suspense. Take the Infinity Man from THE FOREVER PEOPLE. Just what WERE his powers anyway? Actually, Kirby never explained who he was, what he could do or why he switched places with the New Genesis youngsters or, well, a lot of things. Maybe if he had been give more time. (Yes, I still have a sulky grudge about Kirby's Fourth World titles being cancelled when he was obviously heading for the big finale. Grrr.)
Then there was Mr Miracle, the Super Escape Artist. Honestly, he was a disappointment to me. I figured Kirby would take out a few library books of stage magic and apply them to the stories with a new twist. Instead, either Scott Free escaped off-panel or he just used his Mother Box to do whatever was necessary. When the Shadow or Batman were caught in a trap and had to think quick to escape, using whatever we saw at hand, there was more genuine suspense.
Basically, Kirby showed that Mjolnir had the capability to absorb and deflect just about any type of energy.. heat, kinetic impact, radioactivity, magic, you name it. Magneto was sure surprised when Thor drained his powers away and tossed him around. I do like the way Thor has been reading up on physics. For a Bronze Age deity, he shows a good grasp of the subject. Maybe when Don Blake was in medical school, he took a few electives without really knowing why he was interested in someday being able to transmute elements or make a tank fall apart.
This is not just a Thor thing, of course. Comics have always had the problem of having to top the previous month's story. Superman lifted a car overhead last issue? Well, this month he'll hoist a whole train! The Flash broke the sound barrier? Well, now he can run faster than light. Before you know it, the power levels have gone from "that's cool!" to "Oh Come ON!" and you have heroes with such ridiculous abilities that they have to face equally unbelievable challenges and the reader is left behind in disinterest. ("Oh, they're throwing planets at each other, so what"). This is when editorial edicts go out that the hero is drastically humbled. His abilities are cut way down and he has to actually exert himself to earn a victory. (This has happened to Superman a dozen times but sooner or later he gets cranked up again to where he can blow out the Sun if he wants to. It's a cycle.)