A comparator is a circuit that accepts two voltages, and and outputs zero volts if or outputs a positive voltage level if . Comparators can be built from operational amplifiers.
Remember that the gain of the op-amp is extremely large, somewhere on the order of . So if the difference between the two input voltages is around 1 volt, would we expect an output voltage of one million volts? Obviously this can't happen. The large gain of the op-amp is only valid over a small range of input voltages. If the output voltage becomes larger than the supply voltages for the op-amp, then the output will saturate or clip at that level. This means that uncompensated op-amps output voltage as a function of its input voltage will appear as shown in figure 2.
The implication inherent is that an uncompensated op-amp can be used to compare two voltages. The two inputs to the circuit are analog voltages. But if the input voltage difference is only a few millivolts, then the output will be one of two voltages, pegged at one of the two power supply voltages. In other words, the output will be binary in nature and we can use these binary voltages as a way of testing whether or not one voltage is greater than another.