Why does this sort algorithm work?
It is a variant of bubble sort, however the endpoints of the array shift throughout the progress of the algorithm. 

In particular it maintains the following invariant:


  at the end of the $i$-th iteration, the elements in indices $1..i$ are sorted. 


At the first step it finds the maximal element and puts it in index 1.
(prefix length =1). Then, at every iteration $i$ it adds the element in position $i$ to the prefix, and performs a (degenerate) bubble sort on the first $i$ indices. This bubble sort takes only one step since except for the one new element, the other $i-1$ elements are already sorted. The maximal element will now be at position $i$. The length of the sorted prefix keeps increasing at every iteration until the entire array is sorted.

I don't know if this sorting approach has a name. It looks like a type of insertion sort.