This question isn't just about spelling, because when these spellings were standardised, it is highly likely that all these words ending with "-ear" were pronounced in the same way. However, gradually between the 15th and 17th centuries as standardisation was setting in, the Great Vowel Shift occurred, changing the pronunciation of the vast majority of the vowels in English.
This group rhyming with "ear" is usually called the
NEAR lexical set in modern English, and was pronounced /eːr/ in early modern English; in Received Pronunciation this is usually /ɪə̯/, often smoothed to [ɪː]; in the General American standard, it's usually /iɹ/.
A set which was distinct but similar in early modern English was that pronounced with /ɛːr/, as exemplified by the spelling "-are" as in the lexical set
SQUARE. This is /ɛə̯/ in Received Pronunciation (smoothed to [ɛː]), whilst in General American it is /ɛɹ/.
If this is what time did to sounds of
NEAR, why were words like
wear, as well as
where (compare with the spellings of
mere) so different, ending up joining the
In fact, something analogous happened to
steak. Were they to follow the regular pattern set down by
meat, they would have merged into the same set as
meet /eː/ by the end of the 16th century, and then changed into /iː/, modern lexical set
FLEECE by the end of the Great Vowel Shift. Instead, they only went as far as /ɛː/ by the end of 16th century, then went to /eː/ and then to modern /ei/, lexical set
These are all exceptions to the Great Vowel Shift. Notice that these exceptions represented by
bear and by
great appear to be closer to their older pronunciations than their lookalikes
meat. It appears that the former pair resisted the Great Vowel Shift to some degree. But why they were able to resist it, and why they resisted it, are questions as yet unanswered. On a practical level then, these ones should be seen as exceptions and memorised (one particularly relevant one is the dual pronunciation of
tear, which splits according to meaning).
One paper from 1962 complains specifically about how divergent the pronunciation of the spelling
ea is in modern English, despite the fact that most of the words with this pronunciation are of Anglo-Saxon origin.