Unlike other forms of Google search, Google does not display advertising to book searchers, nor does it receive payment if a searcher uses Google’s link to buy a copy. Google’s book scanning project started in 2004. Working with major libraries like Stanford, Columbia, the University of California, and the New York Public Library, Google has scanned and made machine-readable more than 20 million books. Many of them are nonfiction and out of print.

Source : Fair use prevails as Supreme Court rejects Google Books copyright case | Ars Technica