Does scanning comply with copyright law?

Yes. The use Google makes is fully consistent with both the history of fair use under copyright law as well as all the principles underlying copyright law itself. Copyright law has always been about ensuring that authors will continue to write books and publishers continue to sell them. By making books easier to find and buy or borrow from libraries, Google Books helps increase the incentives for authors to write and publishers to sell books. To achieve that goal of discoverability, we need to make digital copies of books which are permitted under copyright law.

This project is actually very similar to web search. In order to electronically index a webpage, you need to make a copy of it. In order to electronically index a book, we have to make a digital copy of the book. As with web search, the copies we make are used to direct people to the original documents themselves.