It's an onomatopoeia indicating that you are thinking about something that another person told you, for example if I offered you a vanilla cookie and a chocolate chips cookie, instead of saying "Let me think about it for a second" you could just use the "hmm" sound and I will know that you are thinking about it without having to use words.
Onomatopoeias are really fun and useful, its a topic worth getting into for a nice read!