When you switch your device (or reset it to factory settings), you can transfer (or restore) your Threema ID and continue to use the app as usual. To transfer your ID, you need a Threema Safe backup. In addition to your ID, Threema Safe contains other important data, such as contacts and groups. The chat history will not be restored with Threema Safe.
Alternatively, you can create an ID export. With the ID export, only the ID can be restored.
With data backups, you can transfer all your data, including chats and media files. However, data backups can’t be restored if you switch between operating systems (e.g., from Android to iOS). When this is the case, it would be best to use Threema Safe.