Sort

Sort[list]
sorts list (or the leaves of any other expression) according to canonical ordering.
Sort[listp]
sorts using p to determine the order of two elements.

Sort uses OrderedQ to determine ordering by default. You can sort patterns according to their precedence using PatternsOrderedQ:

When sorting patterns, values of atoms do not matter: