With these circuits we can observe that at DC a capacitor acts as an open circuit whereas in AC it behaves as a short-circuit.
This is how it happens:
In the upper circuit by pressing the left button we charge the capacitor, and with the right we discharge it. Of course, these process is not instant,so it takes time for the capacitor to either charge or discharge.
Next, in the lower circuit the alternating voltage source acts somewhat the same by pressing the left button in the positive half-period of the sine,and by pressing the right button in the negative half-period of the sine wave.
Thus in a case of high frequency such as 100KHz the capacitor cant keep up with the source and it cant be charged,so it acts like a short circuit.
In the case of low frequency(ex 1Hz) the capacitor have a lot of time to charge and discharge
so it keeps up with the source. In this case it acts as an open circuit.