The list of apps for generating two-factor codes is long and includes Google Authenticator, Authy, Microsoft Authenticator, Duo Security, and others. When you use an app on your phone to generate those codes, it generates keys that are stored on your phone so only your phone can generate the right codes to get into your account. If you experience that horrific moment of losing or breaking your phone, those keys may be lost. All hope is not lost, however, and that is why you are given backup codes at the end of that set-up process.