CNet has a great article on how Google works. Not the search algorithms but the actual hardware and software they run. Google keeps costs down by buying relatively cheap machines and writing their own software. “The company wrote its own file system, called Google File System, which is optimized for handling large, 64 megabyte blocks of data.”
They also plan for failures. They know that at least one machine a day will go down and their system was designed to take it in stride. Their data is stored in three different places to limit any type of failures and they have a “master” machine that can locate any of the copies when needed.