Because the shell won't do command execution within the if condition, it will error out:
conditional binary operator expected
The condition expects an integer within itself, that's why you need the command substitution structure $( ) , where now the shell is told to execute the command within the braces: