• Active Directory associated a unique identifier with each user and group. This is stored by SQL Server with the login (in column SID of syslogins). In each user database, the "foreign key" relationship to syslogins is via the column SID in sysusers.

    So, when you restore a database onto another server in the same domain, SQL can ask AD who the user is and get a valid answer.

    For SQL Server logins, SQL Server creates a SID for the login and stores that SID in syslogins. When you restore a database with users that relate to SQL Logins, there is an issue if you did not create the logins with the same SID on each database server (this is an option that you can specify when using the CREATE LOGIN command)