Not getting the reason of adding [FLAG] bucket in the loop

why sir added the flag bucket to find whether the no. is prime or not i am not getting the idea or logic of doing so can’t understand that please help in this consept