In Irish, the letter “h” is used to soften the letter that precedes it.
The Irish language uses “initial mutations”, in which words undergo a change in spelling and pronunciation, depending on what comes before. For example, the word for “good” is “maith”, pronounced “maw”, with an aspiration at the end (kind of like the second “h” in “huh”). But, after certain words, the word is pronounced “waw”, with an aspiration at the end, and is spelled “mhaith”.
But wait … it gets weirder. In the case of an “m” followed by an “h”, the pronunciation of the “mh” is further dictated by the vowel that follows. The general rule of thumb is that if the vowel that follows is a “broad” vowel (A, O, or U), then the “mh” is pronounced as a “W”, but if it is followed by a “slender” vowel (E or I), then the “mh” is pronounced as a “V”. (That’s the general rule, but there are 3 main dialects in Irish, and the pronunciations can change, depending on the region.)
To answer bump’s question more directly, when Irish orthography was being developed, the monks made up the rules for transcribing the sounds of the words into a written form. I’m not sure exactly why, but they did not use the entire Latin alphabet, and only chose to use 18 letters, but with those letters and the use of “h” as the softener, they were able to reproduce all the sounds of the language.
Also, it isn’t just Irish that seems weird. In English, there are thousands of words that don’t appear to follow whatever rules you think they should. Consider words with the “-ough” ending and all its variations: lough, slough, through, thorough, plough, cough, etc.
I’ve been studying Irish for 4 years now and am absolutely hooked! I’m not sure why. Even though I live in the USA, I am currently going through the study guide for the O-Level “Leaving Certificate” in Irish, which Irish high-school students take at the end of the last year, similar to the SAT or ACT in the USA.