the email is stored in a database,
there is field in the database indicating that this email is inside your inbox.
if you delete the email essentially only the record to indicate that the item needs to stay in your inbox is deleted.
the email stays on the server.