6:40 : Compare Function

How is the compare function actually working? What are the 2 inputs it takes in the comparator in lower bound function?

Please elaborate on points. Thanks!