The last sentence of the last paragraph of the explanation is probably not for this question:
There was only one "a" in the question and not that "a" was removed.Observe that it does not remove all occurences of the element. It removes just the first one. In this case, only the first "a" will be removed.
Not a big deal, but your questions/explanations have usually high quality.
Péter