The Sieve of Eratosthenes
Press Step. Each step circles the next number nobody has crossed out (that number is prime) and crosses out all its multiples in a new colour. Watch how few steps it takes before nothing is left to cross out.
What's going on
The smallest uncrossed number has no smaller factor, because any smaller factor would already have crossed it out. So it must be prime. Crossing out its multiples removes everything it builds.
Notice the first new cross-out for a prime p is always p×p. The smaller multiples like 2p and 3p were caught by 2 and 3 earlier. So once p×p is past the end of the grid, there is nothing new to cross out. For 100 you stop after 7, because 11×11 = 121. For 400 you stop after 19, because 23×23 = 529.
The demo says so when that moment arrives. Everything still standing is prime, even though you never checked it directly.
Sheet: Primes and the Sieve.