How does the photoresistor control the transistor?

The brighter the light, the less the resistance. If resistance is low, the transistor turns off and the motor spins. If the resistance is too high, the motor stop spinning.