Capacitors discharging
With a DC power supply, the capacitor will charge up to the voltage of the supply.

If you replace the DC supply with a resistor, the capacitor will discharge through the resistor until there is zero volts across the capacitor.

With an AC supply, the capacitor will continually charge and discharge as the AC voltage varies.