this because it work as follow

1 it select the min from 1 -> n and put it in the 1st place (n compareson)

2 it select the min from 2 ->n and put it in the 2nd place (n-1 compareson)

.....

n it select the min from n ->n and put it in the nth place (n-n compareson)

so always the iteration is n+(n-1)+(n-2)+...+0 = n/2*(n-1) ie n^2

mege sort and quik sort is order n*lg(n) and this is best order for sorting but complectaed so when we user small numbers we user Selection / Insertion since in this case n^2 and n*lg(n) will be very near

the most problem in quik sort is the pivot because the the chossing of the pivot may change the order to o(n^2)

for example if you use sorted array and you choose the pivot as 1st element

you then divide array to 2 parts 1 greater than pivot 2 less than or equal pivot (if the pivot divide the array to 2 equal size array you reach optimal) but since array sorted the 1st array will contain 1 element and the second contain (n-1) so it as you do nothing