It’s not just that the words came from languages where the silent letters used to be pronounced. It’s also that silent letters were reintroduced by pedants, to remind people of the languages they came from, though they had long since passed out of pronunciation.
Latin debitum went to French and Middle English dette (via *debte). French to this day has no problem spelling it dette. But when in the Renaissance English scribes worked out that dette came from debitum, they put a silent –b– in as a reminder—even though the –b– hadn’t been pronounced for hundreds of years.
Yes, phlegm is spelled like that because it comes from Greek phlegma. But the thing is, both Middle English, and Middle French that the word came via, were more phonetically spelled. And in fact the story of phlegm is much like the story of debt:
phlegm – Wiktionary
From Old French fleume, Middle French flemme (French flegme), and their source, Latin phlegma, from Ancient Greek φλέγμα (phlégma, “flame; inflammation; clammy humor in the body”), from φλέγειν (phlégein, “to burn”).
So the word starts out in Latin as phlegma (complete with p pronounced as /pʰ/.) Along the way, it changes pronunciation to:
- flegma (Imperial Latin)
- flegme (Proto-French)
- fleume (Old French)
- flemme (Middle French)
- fleme (Middle English)
- flem (Late Middle English)
Each phonetic change on its own makes sense as a simplification, and Middle English had no problem spelling the word consistent with those simplifications. (Although silent e‘s and double letters aren’t quite phonetic spelling, they are still useful for differentiating long and short vowels; so flemme or flemm would be a consistent way of spelling it.)
Then in the Renaissance some pedant realised that flemme came from phlegma. As a result, French put back in a silent –g-, and English also put in the Greek ph-.
The change of phlegma to flemme is not random, and the respelling of flemme as phlegm is not random either. But to boast that the randomness is proof of how organic English is, and how it doesn’t have an Académie, is misguided. Respelling flemme as phlegm is exactly the kind of shit an Académie would pull…
Note that the –gm– to –mm– happens in French, and is accompanied by the dropping of final –e. Other Greek words ending in –gma were borrowed later, and directly from Latin or Greek; they have no problem keeping the –gma. Stigma, dogma, magma.
(Vernacular Greek, on the other hand, did simplify –gma. The formal pronunciation of phlegm in Modern Greek is fleɣma; but my grandmother always said flema—by the same process that came up with Modern English and French /flem/.)