Well, qwerty's answer was more precise.
I'll try to be precise just as much:
- your variable may "exist" without any value assigned
- if (%x != $null) is true if %x has *any* value assigned
- if (%x) is true if %x has a value asssigned AND this value is neither "0" nor "$false".