Book pages are basically photographically scanned, and then transformed into text using “Optical Character Recognition” (OCR) and fed to the web in the form of an image with one word that is known to the computer program behind reCAPTCHA and one word that is not yet known.
The user then types both words out and if they solve the one for which the answer is known, the system assumes their answer is correct for the new one. The system then gives the new image to a number of other people to determine, with higher confidence, whether the original answer was correct. Therefore, the system is a self-improving service that gets better with time.
This is why reCaptcha has you enter two words. One of the words is already known, and one of the words is not known. Whether you pass or fail the captcha only depends on how you answer for the word that is known. Your answer for the other (unknown) word will be used, along with other responses to the same word, to turn it into a known word as well.