When doing a query on the search service, the query is sent to the spellcheck agent which gives a list of suggestions for each word of the query.
When indexing documents, the afs_spellcheck_index filter builds a spellcheck database deployed by the afs_spellcheck_deploy filter. Word frequency is taken into account when building the database. Compound words are managed.
The spellcheck agent then uses that spellcheck database to find suggestions for a given word at query time.