Google (and other search engines) index web pages. You can use specific "dorks" to find exposed directories:
In this article, we will break down what this search query means, how directory indexing works, why "private images" are at risk, and—most importantly—how to secure your own web server to prevent becoming the "top" result for this dangerous search.