Both do, called
Spotlight, and it powers a lot of functions.
It will try to index every volume, unless the volume is blacklisted, with a marker sort of like robots.txt. If you've ever come across a flash drive that a Mac OS user has mounted on their system, then see some oddly named files or folders, including one named ".Spotlight-V100" when mounted on Windows, that's where it originates from.
However, I don't think that's the issue here.
The Mac doesn't treat iOS devices like mountable volumes, or a mass storage device like a Windows machine does. The file system is hidden, and only specific apps like Image Capture, or iTunes, will interact with the device, not the Finder GUI/file manager.
Image Capture is one of those native OS bundled utility apps that performs some handy basic functions, like Notepad or Paint does on Windows. Functional, but basic. Once written, they rarely see any further development, or enhancements, other than rudimentary compatibility checks on newer versions of the OS.
The IC app serves not only to provide an interface to extract media from devices, but also as a front end for image scanners.
I rarely task it with extracting more than 100 or so images at once, from my phone with fewer than 6000 images stored, and it's still not a performant program.
I don't think it's reading from the volume index database, but is trying to build a temporary cache each time it reads a device, and is choking on the high number of files in the OP's phone.
A quick check of the copyright shows that it dates from 2000, when OS X first shipped, so the bones of the app were written at a time when iOS devices didn't exist, and the app's function was to pull low res images from digital cameras with relatively small storage capacities, not the gigabytes worth of data on a modern smart phone.
It probably hasn't been updated to handle such amounts of data, and under most use cases, probably doesn't have to. A lot of Mac users have probably never even launched the app, and rely on other methods, like the Photos app, to manage their pictures. It's not a work flow a common user will utilize.
That's why I suggested an alternative, like iMazing, if the preferred method is to do a hard wired transfer.