It uses whichever one is installed and available, the format of the cache files is the same either way so either tool is a drop-in replacement for the other.
Some vendors just ship the one from gtk4 and provide a symlink for the gtk3 name, because it is effectively the same completely standalone program (it doesn't even link to libgtk. The build system statically links it to libgtk, but it doesn't include any gtk headers).