The selection sort algorithm sorts an array by repeatedly finding the minimum element from the unsorted portion and placing it at the beginning of the sorted portion. It maintains two subarrays - the sorted subarray and the unsorted subarray. In each iteration, it selects the minimum element from the unsorted subarray and inserts it into the sorted subarray. This process continues until the entire array is sorted.