In the vast majority of cases, you can put the answer down as "because of the great vowel shift of 1400-1600" and be pretty sure of being correct. English spelling started to be standardised in the same period as English pronunciation shifted wildly.🙂