The same is done in the photos app on iOS and macOS, all locally on device. I don’t have a picture of a drivers license, but I just tried “license plate” and “receipt” and both brought back all relevant results.
OTOH, if I ask Google Photos to show me pictures of me on the beach with my friends X and Y, it shows me a picture from 2005, of exactly what I asked. (literally "me on the beach with X and Y").
And if I ask for pictures of me and my friend Z in a party, it shows me pictures of me at Z's wedding 4 years ago. (literally "me with Z in a party").