Which datatypes can be used in std::max? Anything that has operator< defined. What does it do? That depends on what the operator< for that type does.
So you’se using std::max without a custom comparator function, which means it uses operator< to do the comparison. If you go to std::string on cppreference, there is an explanation what operator< for strings does: lexicographical comparison. So text compare.
This information is indeed in cppreference (top site, by the way), but it can take a bit of puzzling to extract this info.