passwords are hashed using a one way algorithm, and stored in a database

When you enter your password, the password gets hashed and compared to the stored hash
If equal, login accepted
If not, login denied

Passwords are not stored in plain text
To do so would be silly and highly insecure