When a database is migrated to another server by copying the database file or restoring it from a backup file, the original database user account references are also carried with it.
Those accounts contain the account IDs specific to the original database server.
To provide access to the restored database on the new database server we need to delete the old user accounts from the restored database and configure the database access in the new database server. This will re-create the user accounts with the correct IDs in the restored database.
For more information see https://docs.microsoft.com/en-us/sql/sql-server/failover-clusters/troubleshoot-orphaned-users-sql-server?view=sql-server-ver15