Apple’s two-factor authentication (2FA) is a boon for anyone who wants to be sure that even if their Apple ID or iCloud password were stolen or found out, an intruder would still need a piece of equipment associated with the account to complete the login. These trusted phone numbers and trusted devices offer good deterrence.
When you log in to an iCloud account, the Apple ID site, or an Apple app that gives you account access or lets you make purchases, you’re prompted on a trusted device if you haven’t been challenged in a while at the software location at which you’re logging in. It’s in two parts: first, iOS and macOS show a tiny map and Don’t Allow and Allow buttons. If you tap or click Allow, you then get a six-digit code you can enter to complete the login.