An op-amp comparator compares two input voltages, and switches its output between two fixed levels depending on which input is larger.
The output Vout swings: - towards the negative supply rail if Vin is greater than VREF, or
- towards the positive supply rail if Vin is less than VREF.
The high open-loop gain of the op amp will cause the output voltage to enter positive or negative saturation which will be close (but not quite equal) to the positive or negative supply rail voltages.