It's actually not bash that says whether the argument is a directory or not: it's
test
The open square bracket is an alias for a separate system utility named test. That program is responsible for determining if an expression is true or false. If you wanted to verify, you can execute the same commands from the prompt:
Code:
$ test -d
$ echo $?
0
According to the test man page, 0 is true, 1 is false, and 2 indicates an error. I didn't see any explanation of what happens when an argument is absent, but I just skimmed the text. I'd have to look at the source code of test to determine why it spits out that value.
To answer your question though, normally null values and 0 are considered false in programming languages. So there is a little disagreement among shell/programming.