It places each element at the correct position in the sorted list of elements processed so far. It relies on the fact that if merge is given two lists that are already sorted by the predicate the result is a sorted list. A list of one element is trivially already sorted, and the list returned by the recursive call to mysort is also, by definition, already sorted; QED.