The norms for writing words consistently are collectively called orthography. Consistency in writing and spelling is a relatively recent development, largely spurred on by printing practices which allowed writing to be disseminated to a wider audience, therefore replacing regional spelling changes. It is not easy for writers to remember consistent spelling without written reference materials, so consistent spelling was not typical before the late 15th or early 16th centuries in England.
English has an alphabetic writing system based on the Roman alphabet that was brought to Anglo-Saxon England by Christian missionaries and church officials in the 600s. The advent of printing in the late 1400s drastically changed the speed at which manuscripts could be produced, and the adoption of paper also made documents cheaper and therefore more widespread. Not only religious texts, but political and legal documents and stories for pleasure drastically increased in the 1500s.
This time period also saw a rise of schools designed to train religious workers and secular workers for government, which resulted in a rise in literacy and spread the developing norms for orthography. Standard written norms based on London English developed and were widespread even in places where the spoken dialogue did not change, and therefore did not match the “sound” of the written word.
By the late 1500s the large variety of regional spellings had condensed and the English language was well on the way to the modern orthography we use today.