CPP - Strings STL video doubt

In this video, sir has used compare function as an argument in sort function and I am not able to get it how this compare function helps in sorting the strings in lexicographically or lexicographically reverse order, Please help.

compare is basically the parameter of the sort function which helps you sort the data according to the user defined need(data can be sorted in any order). It is our own comparator function and pass it as a third parameter.