How did my new iPhone know my WiFi credentials? I just bought a new iPhone SE to replace a destroyed iPhone 5S. It was set up to the point of being able to make calls at the Apple store, but it was not logged into iCloud. At some point after getting home I noticed it was already logged into my router's WiFi. I had not yet manually attempted to log onto my router. I may have logged into iCloud but this device must have a different UDID than my old iPhone 5S. How then was my new iPhone able to automatically log into my router's WiFi?
iCloud Keychain shares your WiFi networks, including passwords, to all of your devices. So if your new phone had been logged into iCloud, that’s where it got the network details.