Comparators in C++

I am not able to get what is a Comparator function in c++. How does it work and what it does.