Modern English inherits a layered language: Anglo-Saxon/Scandinavian + Norman French + Paris French + Latin + Greek. But it is aware of this, and has been for centuries, and has built the awareness into its spelling.
In Samuel Johnson's introduction to his 1755 "Dictionary" he says that where a spelling was unsettled, he based his decision on pronunciation and etymology, and he gives the edge to etymology:
[M]any words have likewise been altered by accident, or depraved by ignorance, as the pronunciation of the vulgar has been weakly followed; and some still continue to be variously written, as authors differ in their care or skill: of these it was proper to enquire the true orthography, which I have always considered as depending on their derivation, and have therefore referred them to their original languages.
In that test of origins, by Johnson and others in his day, modern spelling is forged. Mortgage is spelled with a -t- because death is in it. The -c- in Arctic touches Arcturus.
Johnson's notion of the language was literary, not popular. Universal literacy and public education were beyond his ken.
When Johnson published the second edition of his dictionary in 1768 he boasted not that it contained all the new words that had come into the language since 1755, as a modern dictionary would, but that it had more of the words of Spenser, Shakespeare, and Milton.
Nor are all words which are not found in the vocabulary, to be lamented as omissions. Of the laborious and mercantile part of the people, the diction is in a great measure casual and mutable; many of their terms are formed for some temporary or local convenience, and though current at certain times and places, are in others utterly unknown. This fugitive cant, which is always in a state of increase or decay, cannot be regarded as any part of the durable materials of a language, and therefore must be suffered to perish with other things unworthy of preservation.
In other words, no slang, no jargon; that was vulgar English — "fugitive cant." The authors might speak it in taverns, but they did not dip their pens to it. Johnson doesn't say popular language doesn't matter, or that only his words ought to be used by everyone. He says these low words are not permanent things. They are the stuff of a language, not the brains of it.
Johnson is not writing his dictionary to dictate what words the lovesick swineherd may and may not use to woo the silly shepherdess; he's not telling the prodigal son how to write his remorseful letter to dad. But he's showing them how to put power in their syllables, if they want it.
Writing in English shrivels up after the Norman Conquest in 1066. Latin and French are the language of government, religion, and literature. There seems to be no standard spelling in early Middle English, which is probably the age when English spelling most closely follows pronunciation.
When English emerges again wholesale in writing in the 1300s, it begins to acquire a standard spelling. This is largely based on two institutions where a great many of the people writing the manuscripts — whether literature or government papers — worked. They were the elite class of professional writers who helped shape modern English.
Guildhall was the London city hall, the seat of the municipal government. There a team of clerks and scribes, probably a couple dozen at a time, worked for the mayor and aldermen of the city and the sheriffs. The clerks also worked ad hoc for the London livery companies. And in their down-time when the city courts were inactive, at Christmas or over the summers, they were copying out, freelance, prized editions of Chaucer for wealthy customers.
Probably more important to English were the clerks of the Chancery — the royal government in Westminster (outside the walls of London and safe from its mobs in 1400, but well within the built-up city today). "Chancery Standard" was, from the early 1400s, the official written language of the English government.
In the 1400s, the Chancery was almost the entire national bureaucracy (except the Exchequer). The royal chancellor had a staff of skilled assistants. By 1400 it is estimated the chancery was composed of 120 clerks. Each of the 12 major clerks had his own house where minor clerks and candidates for clerkship lived, along with aspirants to the Inns of Court, who there learned the mysteries of writs and pleas and other formal procedures of administration. Correct use of the standard language was essential.
These professional scribes of the Chancery Office wrote almost all the royal government's legal documents, which circulated throughout England. Their primary concern would have been to maintain a comprehensible official idiom for communication through the kingdom. This hardly need have anything to do with pronunciation.
The Chancery Standard that emerged from the 1300s was, as such things tend to be, backward-looking and conservative. Though phonetic spellings for words like high and though were in use from the 1300s, Chancery scribes kept the old spellings, no longer reflecting the pronunciation.
In the 1400s the Chancery scribes made choices between the options in front of them. Some of the options were rooted in England's dialects: egg or ey? shoes or shoen? They went with egg and shoes, and we've followed them ever since.
To say they had etymology in mind doesn't just mean they looked to the past. It means they had a mind to the familial relationship of the forms, not just to the sound of the words. So in the 1300s you would have had kingez with a -z as the plural of king, but the Chancery scribes would make it -s; all the "s" plurals became -s, even if they sound like -z.
William Caxton, the first English printer (working in the last quarter of the 1400s), churned out hundreds of books and helped set the spelling standard. He published chivalric romances, classical works, Aesop's Fables, the Reynard the Fox stories, English and Roman histories, and poetry by Chaucer and his contemporaries. These were the books that appealed to the English upper classes in the late 1400s.
Caxton printed almost nothing by contemporary authors. That had an effect on the spelling. Chaucer (dead a century by then) was so important and so well-known that Caxton didn't modernize his spellings, even though the kn- and -gh- in knight no longer were pronounced. The general tendencies that Caxton began, or rather continued from the Chancery and the Guildhall, were continued by his successors.
The idea of "writing" in the minds of all these clerks and scribes is not the internet or public education of everyone’s children. Neither is it textual representation of speech. They were solving the practical problem of how to send documents that could be understood across the King's realm in 1421.
And ever since then, reformers have been trying to "fix" English spelling, to make dogs have a -z and cats have an -s. And then you lose the notational quality of what the plural affix is. Forget spelling reform based on pronunciation. Whose pronunciation should we choose? Modern sensibilities would disdain as prescriptivist any standard of spelling, however logical or practical, that ignores everyone else's individuality or anyone's group identity. What you'd end up with if you shifted English writing to a purely phonetic basis is, at best, a set of 20 or 30 mutually incomprehensible writing systems — one each for London (probably actually 5 or more just for London), Jamaica, Edmonton, Singapore, Perth, New Delhi, New Orleans, Lagos, etc., etc. At worst, every individual would have his or her own ever-shifting standard of spelling. Come to think of it, that's Twitter.
In the 1500s, after English has ousted French as the language of literature and governance in England, the scribes and scholars begin to deliberately change it.
English writers begin to pull their Latin words directly from ancient Roman secular writers rather than Medieval Church Latin or French. And the writers and scholars look at the older words which came up into English through vernacular French from Vulgar Latin, and they recognize the slop and scars.
In the 1500s and after, knowledge of etymology becomes a driver of English spelling. The writers in the language begin to rinse the French from their words.
Chaucer's pilgrims came together by chance, or as he put it, by aventure. By the 1500s this word has become adventure through awareness of Latin and that it is a compound in ad. And so Middle English amonish becomes admonish. Aminister, administer. Avance changes to advance. The restored forms then changed the pronunciations.
But sometimes they don't, and they leave a spelling dissonance, as in indict, which before 1600 or so used to be spelled endite and still is pronounced that way.
They restored -d- in adjudge and the -b- in debt, doubt, and subtle, though none is pronounced. Victuals was respelled along the Latin model in the 1500s, but it is still vulgarly "vittles." The restored classical –h- has changed the pronunciation of authentic, horizon, Hebrew, hypocrisy, hectic, and homily. But in stomach, asthma, school, chronicle, chameleon, character, rhyme, and rhythm, it has not.
The -l- was restored (and generally sounded) in fault, vault, assault, culpable, and cauldron. The -g- came back in impregnable and cognizance. The -p- in corpse. The -n- was restored in convent (its doublet, coven, hasn't changed, probably because it had taken on a specialized, non-classical sense).
Sometimes the effort to be classically correct went too far. Admiral had been amiral, which was right, the word was from Arabic and is the same as emir. But presumed Latin added an excrescent -d- to it. As the pronunciation followed the change, the etymological error did not create a spelling trap.
It does, however, in scythe, an Old English word, which was falsely derived from Latin scindere "to cut," and so a -c- was added. A faulty etymology of a Germanic word as a Latin one also put the -s- in island, presuming it was based on isle. Even worse, the mistake contaminated the unrelated word aisle (of a church); it comes from a Latin word for "wing," but by the late Middle Ages it had become confused with the isle that means “island,” and it partook of the excrescent -s-.
Sometimes they just bungled it: Anthem was Middle English anteme; the -h- is an attempt at Greek, but the Greek word was antiphona. Comptroller is a bungled etymologizing of controller as though it came from Latin computare (the verb behind computer). Author and authority acquired the -h- by confusion with authentic, but author and authority are from Latin, not Greek, and they never had a -th-.
Not all of it has stuck: Conceit, deceit, and receipt all are from Latin capere; the -p- sometimes was restored in all of them, but it has stuck only in the last.