When a capacitor and resistor are connected in series to a voltage source via a switch, the capacitor will charge exponentially when the switch is closed and discharge exponentially when the switch is opened. The time constant (τ) of the circuit, which is equal to the product of the resistance (R) and capacitance (C), determines the rate of charge and discharge. Specifically, it represents the time required for the capacitor to reach 63.2% of its maximum charge during charging or 36.8% of its maximum charge during discharging. The current through the circuit also follows an exponential decay/growth formula determined by the time constant τ.