inputbox asks user to type the password in the box.
if cancel button is pressed, the condition within If EndIf block is satisfied and Exit Sub statement terminates the macro.
if wrong password is entered, other condition within If EndIf block is met and Exit Sub statement terminates the macro.
if the correct password is entered, it maenas above conditions are not met, Exit Sub statements kinda gnored and code execution skips to next line.

you dont have to assign your password to a variable. you can also rewrite the code as below:

Sub vbax_54262_Password_Run_Macro() 
     
    Dim vPass As Variant 
     
    vPass = Application.InputBox(Prompt:="Please enter password to proceed...", Title:="Password", Default:="Password") 
     
    If vPass = False Then 'Cancel button pressed
        MsgBox "You pressed cancel. Quitting macro....", vbOKOnly, "Cancelled" 
        Exit Sub 
    End If 
     
    If vPass <> "RealPassword" Then 'Wrong password entered
        MsgBox "Please enter correct password. Quitting macro....", vbOKOnly, "Wrong password" 
        Exit Sub 
    End If 
     
     'all code here when password is correct
     '
     '
     '
     
End Sub