The other aspect would be if Google were able to cross-reference address book contacts that were obtained from permissions from their apps/services to check what name is most commonly associated with that number.
I loved looking up number owners as a teen. I don't know why. It was right there on the monopoly telco's website.
I ended up being on a bunch of conference calls during COVID, and from what I recall, there was a roughly (it varied significantly between calls) even split between:
* caller ID shows the correct name (but maybe misspelled, though misspellings were more common when the host tried to add/correct information from one of the other types)
* caller ID shows the name of a spouse/parent/sibling (one notable example: husband and wife both joined the call separately, both with the husband's name, but one including the middle initial)
* caller ID shows the name of somebody vaguely involved with the actual person for some reason
* caller ID just shows something generic, like a brand or "wireless caller"
* caller ID fails so just a number
Maybe 1% of users used the app and so didn't have an associated phone number, just a username/email. At some point I was surprised to discover that video calls were in fact supported.