Doubt in the question

Inside the for loop the primes[i]*primes[i] <= No; is not clear, please help me out

all prime factor occur before the square root of the number hence we run the loop uptil the square root value of the number