Basically insert at -1 inserts the item before the position specified (so before the last element). Also remember the list is being mutated as you go.
So the first iteration of the loop results in: [1, 1, 2] because the element at index 0 is 1 and we insert it before the last element. The second iteration results in [1, 1, 1, 2] because the new value at index 1 is now 1 and we insert it before the last element.