A few ways.
For older stuff, produced before books were typed on a computer, you can do a few things:
1) (Mainly an older technique now I'd guess.) Just pay someone to copy it out by hand. Long and laborious, but they get paid.
2) You can get machines to turn pages of a book, and then scan them into a computer. Or at the very least, have someone turn the pages of the book then put it on a scanner.
For (2), once in the machine, you can use OCR software to let the computer read the text, if that needs to be done. This can either be done by sophisticated software, or a few other methods.
One clever method is using CAPTCHAs. A CAPTCHA is a method of stopping spam on websites. You've probably seen them. Before you sign up for a service on some website, you may be shown an image with some letters jumbled up, with some wavy lines or something. They're designed to be easy for a human to read, but hard for a computer. So you enter the letters correctly, and then pass the test (you're not a spam machine just making fake accounts).
But instead of this image just being random letters or words, you could tie it up with picking some words that the OCR machine reading books can't properly understand. This way, the human wins (they get into the website), and the computer does too, meaning that more of your books can be understood by computer.