Natale Wolchover investigates its origins: 

Hmm is technically categorized as an "interjection," along with the likes of um, huhouch and wow. It's also "sound symbolic," along with onomatopoeia words like plopping or oink— "except that it's symbolic of, really, nothing … The first h-sound is simply a substitute for breath, and the second m-sound, since the mouth is closed, is symbolic of the fact that we're not quite sure what to say," [Linguist Anatoly Liberman] said. The pause filler indicates that we're temporarily speechless, but still engaged. The variety of tones we may take add subtle meaning to the interlude. Nicholas Christenfeld, a psychologist at the University of California, San Diego, and an expert on filled pauses, suspects hmm is popular primarily because it's such a neutral sound. That is, "it's easier to say than anything else," he said.