Hy, This is one of my favourite projects because it is easy to make and needs a very few things. Mind it that I have not Invented it. Just made it by the help of other websites. As the current from the electrodes flow to each other through water and earth is provided the transistor gets charged and turns the led or the buzzer or whatever you have attached. I hope you like it.