Your 2FA secret is tied to the physical device you set it up on. If you lose that device, need to restore it from a backup, or even just delete the app then put it back, the ONLY way to get into your account is using one of your lockout codes. Store a copy of them now! The simplest way to store them is to just print them out, but keeping them in a secure digital location (like in a password vault like 1Password or LastPass) also works.
This is true whether the phone is lost, stolen, destroyed, sold, replaced or reinstalled. Your 2FA secret is stored on the specific physical device you set it up on, and on that device only. The secret is not stored in backups or syncs, so restoring a new device from a backup of your old device will NOT set your 2FA up again.
Why? If Google Authenticator synced your 2FA secret, then someone else could gain access to your 2FA codes by simply setting up a new phone/device from a backup of yours.
So, store your codes and keep them in a safe place.