Two years ago I tried to arrange my bookshelf by height, shortest on the left. I had no plan. I just picked up the shortest book I could find in the whole pile and placed it at the start. Then I looked at the remaining pile, found the next shortest, and placed it right after. I repeated this until the pile was gone.

That is selection sort. No fancy math needed to understand it. You already ran the algorithm once, on real books.

How Selection Sort Actually Works

Selection sort splits a list into two sections: a sorted section at the front and an unsorted section behind it. On every pass, it scans the entire unsorted section, finds the smallest value, and swaps it into the first open spot of the sorted section.

Here is the pass-by-pass version with the array [29, 10, 14, 37, 13]: