NULL is a macro that expands to either 0 or 0L, this is a null pointer constant.
A pointer points to an object of a particular type, ie int * is a pointer to an int object.
A pointer holds a value, either the address of an object or a null pointer value. A null pointer value indicates that the pointer does not point to an object.
When you compare a pointer to NULL, i.e pointer == NULL, The null pointer constant(NULL) is type converted to a pointer to an int and assigned a null pointer value. This can then be passed to the comparison operator which will return a bool with an appropriate value.
When you call if(pointer) the pointer needs to be type converted to a bool. If the pointer holds a null pointer value, the value of the converted bool is set to false (indicating that it doesn't point to an object) else it is set to true (indicating that it does point to an object).