When you restore a database, you restore a database, and if there was a database in place with the same name, this database is entirely flattened. There is no merge of logins or anything. BACKUP and RESTORE are low-level operations that works with pages with a minimal understanding of what is in those pages.
If you are regularly restoring a database from one environment to another, and you want to retain permissions, logins created in the target environment, you need to cater for this by having a post-install script to permissions and users.
When it comes to SID for SQL logins, they can be handled without post-processing, though. When you create a login you can say:
CREATE LOGIN nisse WITH PASSWORD = 'ToppSikrit' SID = 0x.....
So once you have created a login on one server, you capture the SID and the use this SID when you create a login with the same on the other servers.