Two-factor authentication adds an additional layer of security by requiring not just a password but also a second form of identification. This second factor can be something the user has (e.g., a smartphone or a hardware token), something the user knows (e.g., a PIN or a secret question), or something the user is (e.g., a fingerprint or facial recognition).