I recently turned on a computer that had been unused for a while and was having trouble signing in with the correct password. I tried another account, and the system asked for a confirmation code sent by email. The code seemed to be requested successfully even though I believed the computer had no Wi-Fi or wired internet connection. How could that happen?
3 Answers
If the confirmation email actually arrived, the computer had some form of network access at that moment. Wi-Fi may have re-enabled after startup, it may have automatically connected to a nearby saved network, or an Ethernet connection could have been active without being obvious. The operating system can contact account services before you finish logging in.
It probably was not an email confirmation at all if no connection existed. Some services use time-based one-time passwords generated from a shared secret, so those codes can work offline. However, a code specifically sent by email requires the computer or another device to reach the service, unless the email was already sent earlier.
There is a difference between displaying a message that a code will be sent and actually sending the request. If the code never arrived, the request may simply have been queued or shown locally. But if a new code was delivered to your email, an internet connection was available somehow.

A computer can also be connected to the network at the sign-in screen. You do not necessarily need to be logged into the desktop before Windows or another account service can contact its servers.