I got this wrong, but having read the explanation I'm still none the wiser...
To understand the mechanics, start with the subquery:
FROM Emptable AS Emptable_1
WHERE (Empid < 5)
This returns four rows (because Empid is an IDENTITY with the default starting value of 1). In these rows, the Departmentid (which is what is SELECTed) is 2, 5, 6, and 3.
Now the WHERE clause of the outer query reads (pseudo-code, as this is not valid SQL anymore):
WHERE (Departmentid <> ALL (2, 5, 6, 3))
The "ALL" qualifier means that the predicate has to be true for all rows in the subquery, so all of these four have to be true:
Departmentid <> 2
Departmentid <> 5
Departmentid <> 6
Departmentid <> 3
Or, in plain English, the Departmentid value can not be equal to any of the values 2, 5, 6, and 3.
In the table, there are two rows, with Departmentid equal to 4 and 7, that satisfy this condition. Those two rows will be returned.
Exercise for the reader: replace ALL with ANY, try to predict the results, then run the code and check if you were right.