The bash if statement doesn't do conditional at all, the test builtin does. Bash creates an alias called '[' so you can do 'if [ "$x" = 2 ]; then' and make it look nice. The if statement actually just performs another statement, and if the statement returns 0 then it does the stuff between 'then' and 'fi'. And of course all executables and bash commands return status integers.
So you were close.