I have noticed that certain, seemingly random, words tend to sometimes have “ie” or “ei” in them. For example, the word “Foreign” has an “e”, followed by an “i”, but the word “friend”, has an “i”, followed by an “e”. Why is this, and does one structure have a particular etymology that is different from another?
Foreign is from Old French and entered the English language in the 1300s. At this time it was spelled (most of the time) ‘ferren, foran, foreyne’. The spelling was altered in the 17th century most likely to match other French origin words like ‘sovereign’ and ‘reign’.
Friend is from Old English ‘freond’. Its pronunciation was probably influenced a lot by the Old Norse presence in the East in the 9th century when a lot of sounds were broadened (ON friend ‘frændi’).
If you listen carefully, foreign and friend don’t have the same ‘e’ when they are pronounced. The first one is lower and closer to a schwa. The second one is broader and closer to the ‘e’ in ‘bed, ‘met’, or ‘bled’ (which are all from Old English).
Although not 100% consistent, the spelling of words can be understood from which language and what time the words entered the English language and whether or not they were revised at some point (such as Samuel Johnson), who was probably responsible for the current spelling of ‘foreign’.
Most words with the short ‘ie’ variation come from Old English (thief, lief). Words with the long ‘ie’ sound (grieve). Note also that ‘sieve’, which has a short sound when its pronounced, comes from Old English.
Most words with the ‘ei’ spelling are a result of 17th century revisions to try and distinguish between OE and OF origin words. But Johnson and contemporaries missed quite a few so it’s really all over the place.