The built-in English word list on my computer has 45k words in it (probably 15k roots, plus various sufficies and such).
The ispell program preprocesses the word list and then can quickly take new words and determine if they are on the list. Words not on the list are flagged as misspellings.
Supposedly misspelled words (proper names, technical terms) can be added to the word list so they won't be flagged later.