Does a backup contain pins?

When backup, does the output contain the primary/second/self-destruct pins or backup passphrase?

If contains, will the corresponding pin/passphrase be overwritten by restoring a backup?

No, PINs are set per device and are not related to backup. The backup file also does not contain PINs or passphrase, backups are the AES-256 encrypted contents of the OnlyKey. If the OnlyKey restore is a success you would already have to have the correct passphrase loaded on your OnlyKey, if not the restore would not succeed.

ok, thanks for the detail explaination.