During the building of these databases, certain parts of each webpage are recorded separately, like the title and web address. The technical term for this is a 'field'. It works much the same as books in the library are indexed by title, author and subject. Search engines also record the order words appear in each webpage, so we can craft a search request for words appearing next to each other on the webpage. Commercial databases, like the ones on CD-ROM in your local library, let you dictate precise distances between desired words.
Field searching and proximity are the keys to a more valuable search.
Don't trust this ranking system. You can do so much better simply crafting a more precise search request. If you search for patent research, you are asking for all the webpages with the words patent or research. This is why the number of matches are so very large. For reasons beyond my comprehension, word1 and word2 often means word1 is optional.