I believe this is called Canadian Raising.
Canadian raising is a phonetic phenomenon that occurs in varieties of the English language, especially Canadian English, in which certain diphthongs are "raised" before voiceless consonants (e.g., /p/, /t/, /k/, /s/, /f/).
/aɪ/ (the vowel of "eye") becomes [ʌɪ] or [ɐɪ], while the outcome of /aʊ/ (the vowel of "loud") varies by dialect, with [ʌu] more common in the west and a fronted variant [ɛʉ] commonly heard in Central Canada. In any case, the /a/-component of the diphthong changes from a low vowel to a mid-low vowel ([ʌ], [ɐ] or [ɛ]).
Below is an excerpt of the possible origin paragraph in the Wikipedia article.
Some have hypothesized that Canadian
raising may be related historically to
a similar phenomenon that exists in
Scots and Scottish English. The
Scottish Vowel Length Rule lengthens a
wide variety of vowel sounds in
several environments, and shortens
them in others; "long" environments
include when the vowel precedes a
number of voiced consonant sounds.
This rule also conditions /aɪ/ in the
long environments and /əɪ/ in the
short environments. Significantly,
though, the Scots Vowel Length Rule
applies only before voiced fricatives
and /r/, whereas Canadian raising is
not limited in this fashion; thus, it
may represent a sort of merging of the
Scots Vowel Length Rule with the
general English rule lengthening
vowels before voiced consonants of any
sort.
The most common understanding of the
Great Vowel Shift is that the Middle
English vowels [iː, uː] passed through
a stage [əɪ, əʊ] on the way to their
modern pronunciations [aɪ, aʊ]. Thus
it is difficult to say whether
Canadian raising reflects an
innovation or the preservation of an
older vowel quality in a restricted
environment.
The letter e in English commonly makes two different sounds:
The "long" e is [i] in IPA, and is found in words such as keep, bean, read, and compete. It's generally spelled with a digraph such as ee, ea, or eo, or is indicated by a final silent e in the word.
The "short" e is [ɛ] in IPA, and is found in words such as bet and left. It's generally spelled with a simple e followed by one or more consonants.
The names "long" and "short" for these sounds is completely conventional, as they don't have anything to do with vowel length in modern English.
The sound which appears to be giving you trouble is [ə], the schwa which appears in unstressed syllables. In English, any vowel can reduce to [ə] when it becomes unstressed, and therefore [ə] can be spelled by any vowel letter. If you are simply trying to find out how a written word is pronounced, this makes things rather easy, since any unstressed vowel is likely to be pronounced as [ə]. On the other hand, if you're trying to figure out how to spell a word whose pronunciation you know, this makes things very hard, since the [ə] sound could be spelled with any vowel.
There are exceptions to all of these rules, since English spelling is a disaster, but this should get you started. When in doubt, you should always consult a dictionary to see how a word is pronounced or spelled.
Best Answer
Part I
The rule that Peter pointed out in comments is that it is voiced only in function words, not in others. (In fact, this is more of a law than a rule really, because it has no exception in English.)
The complete list, excluding derived terms based on words in this list, is:
Notice how those are all function words of one sort or another, not nouns or verbs.
Note that English also has a few words that begin with th where the h is silent, like Thomas and Thames. Those you just have to learn by rote. There are not very many of them, but they can be quite common.
Part II
The second part of the question asks whether there is a reason for these differences. We don’t know for sure, but function words tend not to be stressed, which tends to make them run together and experience greater assimilation with surrounding sounds. This might have caused the voicing to stick around there.
Wikipedia suggests:
In a comment, I note it is also rare to find a word than ends in voiced -th (without an e following it), with smooth and the verb mouth /maʊð/ being notable exceptions. And by rights, that one really ought to be spelled mouthe, like all the others (bathe, clothe, breathe, etc.). Voicing wasn’t phonemic at the ends of words, and happened only with a following inflectional vowel. Hence unvoiced in nouns house, wolf, bath but voiced in verbs house, wolve, bathe, even when not in the third-person singular -s form.
This is related to the intervocalic voicing described above. It is retained even when we have lost final e, whether just in pronunciation or in spelling as well.
Footnotes