https://www.theiphonewiki.com/wiki/UDID
For Apple to be telling you what kind of device it is, they either have to have a database of all the devices as they are built or a database of devices which have been checking in to their servers. (I'm betting the latter is what is happening here, but the former would be fundamentally more interesting to me.)