Because you are using the abstract equality operator (==) which allows the interpreter to coerce the types on either side of the comparison. Not sure which way it is trying to do it, either null is coerced into undefined (the type) or undefined is coerced into (object (the type of null)); I suspect the former. However once the coercion has happened the resulting values of the 2 sides are the same.
If you used the script equality operator (===) then the types have to be the same since the type of null is object and the type of undefined is undefined the operator will return false.