Many data types have an intrinsic ordering. This is obvious for the primitive numeric types. Characters are also ordered by their ASCII or Unicode values. This is the same as the usual alphabetic ordering for letters of the alphabet. The ordering of characters can be extended to the usual lexicographic ordering for strings.
When writing a sorting or searching algorithm, the nature of the elements sorted is usually unimportant. It is only necessary to refer to their ordering relation. Here is an example.