How does UVM Comparator works?

In reply to Reuben:

Yes, they have fifos that they store the transactions in. You can always look at the source code and see how it works.