It looks like you're using Internet Explorer 11 or older. This website works best with modern browsers such as the latest versions of Chrome, Firefox, Safari, and Edge. If you continue with this browser, you may see unexpected results.
For a book to be legally digitized and available online, either the holder of the copyright has to give permission for the digitization, or the book needs to be in the public domain. In the U.S., books in the public domain are usually those that were published prior to 1923, although under certain limited conditions later works may also be in the public domain. For the most part books that are freely available online will be those that are in the public domain.
Google has partnered with a number of universities to scan the full-text of public domain books in the university library collections. In addtion to the full-text of the books in the public domain, for many titles Google allows you to view snippets or selected pages from books still under copyright.