An algorithmic analogy I would use would be fuzzy matching. Most people's brains are set to look for exact matches (or fuzzy matching with a super high match criteria). When one part of their brain needs access to a word, the other part of their brain will supply the exact match. My brain is using fuzzy matching with the confidence level set mistakenly low. When part of my brain needs a word, the first match returned is occasionally a false positive match. The rest of my brain just accepts it and continues onto the next requested word. The match quality isn't a traditionally fuzzy matching algorithm like Levenshtein distance. It is heavily weighted to both the start of the word and the expectedness of the word in the given context. The latter makes it very difficult for me to immediately notice my own written mistakes since I am already primed to expect what I intended to write and not necessarily what I actually wrote.
I seem to be able to break the spell in a number of ways. When I'm re-reading a final draft of something (say an important email) I will try to eliminate context and deliberately read each word individually. Another way to break this spell is to read a document much later in time. Sometimes the pattern matching self-corrects later, or seemingly I have forgotten the verbatim phrasing of the idea that I previously wrote, and so upon reading I pick up the mistake.
I read thousands of words per day, probably write well into the hundreds. Fortunately, the amount of errors for me is very low, but if this were to happen with increased frequency, reading and writing would be quite stressful.