The list items are removed one-by-one and when items are removed from the list, the indexes of everything that comes after it are shifted back. This is why the indexes end up referring to different items than in the initial position.
If you can't see this easily, step through the code in a debugger or even "run" the list manipulations manually on paper, step by step.