Tokens are dynamically generated based on your private keys. These keys and other data necessary to generate tokens are stored locally on your device and protected against access by other applications.

If you use the iCloud or Google Drive backup option, then your keys and all necessary data are encrypted and stored respectively in the Apple iCloud or Google Drive accounts. In both cases, the data is available only through the 2FAS application.