exit is usually a shell built-in, so in theory it does depend on which shell you're using. However, I'm not aware of any shell where it operates other than exiting the current process. From the bash man page,
Cause the shell to exit with a status of n. If n is omitted,
the exit status is that of the last command executed. A trap on
EXIT is executed before the shell terminates.
So it doesn't simply end the current
if clause, it exits the whole shell (or process, in essence, since the script is being run within a shell process).
From man sh,
Terminate the shell process. If exitstatus is given it is used as
the exit status of the shell; otherwise the exit status of the
preceding command is used.
And lastly, from man ksh,
† exit [ n ]
Causes the shell to exit with the exit status specified by n.
The value will be the least significant 8 bits of the specified
status. If n is omitted, then the exit status is that of the
last command executed. An end-of-file will also cause the shell
to exit except for a shell which has the ignoreeof option (see
set below) turned on.