One is built to keep its two inputs equal. The other is built to notice, instantly and decisively, whenever they aren't.
Draw an op-amp and a comparator on a schematic and you'll get the same triangle with two inputs and one output. That visual similarity hides a completely different design intent. An op-amp with negative feedback wants its two inputs to end up at the same voltage — that's the whole basis of the virtual short. A comparator wants the opposite: it's built to notice the instant the two inputs differ and slam its output to one extreme or the other as fast as possible. Confusing the two — or swapping one in for the other — is a classic way to build a circuit that technically has the right parts but doesn't work like you expect.