The equality comparison is comparing two values. A constant value of 3 on the one side, and the value returned by a subquery on the other side.
If the result of the comparison is TRUE for a row being evaluated, then the row will be returned. Otherwise, the row won't be returned.
The "trick" here is the subquery on the right side. That's what we call a "correlated" subquery. That gets run for every row that's being evaluated.
Basically, the operation can be described like this...
Access a row from salary
table, and get the value of the salary
column from it.
Run another query, using the value of salary
column to get a count.
Compare that count to a constant value of 3.
If the comparison yields TRUE, return the row, otherwise discard it.
Access the next row from the salary
table and get the salary value.
Run another query, using the value we just got, to get a count.
Compare the count to a constant value of 3.
If the comparison yields TRUE, return the row, otherwise discard.
And just repeat that until we've done it for all rows in the salary
table.
The final step is the DISTINCT operation, which eliminates any duplicates that we would otherwise be returning.
That's how it's performing.
In terms of performance, on large sets, a correlated subquery is going to each our lunch, and our lunch box too. This is not the only query pattern that can return this result, there are other queries that will do less work to return an equivalent result.