Why is this happening?
Apple implemented two-factor authentication (2FA) as an additional layer of security for user accounts. With 2FA enabled, hackers will need two pieces of evidence to log in to your account - something you know (your Apple ID and password) and something you have (a trusted device, such as your iPhone or Apple Watch). This way, even if a hacker has your Apple ID and password, they won't be able to gain access to your account unless they also have access to one of your trusted devices. This makes it more difficult for hackers to gain access to your account, and it is recommended that all users enable 2FA on their Apple devices.