Behind the science
A resistor-capacitor circuit obeys dVᶜ/dt=(Vₛ−Vᶜ)/(RC). During charging its voltage approaches the supply exponentially; during discharge it decays exponentially. The time constant τ=RC is the characteristic response time. The switch alternates between supply and ground.