I had to watch it twice and pause to see what the L was going on.
Apparently, it is based on prediction. For instance, if you press <qaz> <yhn> <edc>, it figures out that the statistically most common word from those three columns is "and".
The video does not tell what happens when there is more than one word that matches and the prediction is wrong, or what happens if you misspell a word...