lexiographic string

In this article it says - " If fz >= K, append ‘z’z k times in the string T and keep removing characters from the left of S until all the z’s are removed ".

we should only remove the ‘z’ letters, But why are we removing the letter’s except ‘z’ also. I can’t understand that.
Someone Please explain.

If we include any other letters in the result string, the string would be lexicographically smaller: zzzz > zzzyz. So to find the max, we can’t take any of the characters before the last of the largest qualifying character.