If the entered password contained in the variable %pass% is identical to the stored password in %password% then the IF test will be satisfied.
Personally I would not use the /i switch when checking a password. For obvious reasons.
In fact personally I would not be using a batch file to verify a password in a real life working situation where protection of data or preventing unauthorised access were important.
Agreed about the /i switch and doubly agree with using a batch file for password authentication. However this was simple a response to the OP who volunteered he was using
set /p pass= which implied he wanted a batch solution.
One small note: there is no %password% variable.
password is a literal that is the actual password.
If the OP has to have stars, a Powershell solution will accommodate him but the prerequisites seem a bit steep for such a simple request.
Between password protection using batch files and converting simple text file scripts into executable files, I wonder why all this is necessary. Paranoia runs deep I guess.