The capacitor (which could be a person, an iron item or whatever you want) is detected when it touches the +5Vcc by the ammeter. In the simulation, the "touch" is represented by the relay and the resistor is needed to discharge at the end of the touch.