You have observed the analogue flame sensor (KY-028) detect the flame from the lighter and sends that signal to the analog pin on the Arduino. The Arduino controls the relay module which is the device that activates the fan and uses the code that was programmed to the board to turn on the fan when the flame is detected and turn off the fan when the flame is off. This is possible because the circuit was set in such a way that the fan is in state known as normally closed (fan off) until it receives the signal from the Arduino and switches to normally open (fan on).