It makes sense if you separate the indexing process from the result ranking/retrieval process. Building up the index it has encountered the word “dog” millions (billions?) of times, but the Google search API’s job is NOT to operate as a catalogue that will list every single web page on the internet with the word “dog”. Instead its job is to show you what it thinks are the most relevant dog results.
That said I think this could be communicated more clearly when you get to the end of the results. The fact that the results number _changes_ is an own goal that makes it seem like they have something to hide. Instead it should just say “Google Search shows a selection of the most relevant occurrences of your search term. If you didn’t find what you need, try XYZ.”