When a capacitor is connected to a circuit whose power source is direct current (DC), under certain circumstances, two processes will occur, namely the "charging" and "discharging" of the capacitor.
If the capacitor is connected to the DC power supply, as shown in Figure 3, there is current flowing in the circuit. The two boards will receive equal amounts of opposite charges, and the capacitor is charging at this time, and the potential difference vc between its two ends gradually increases. Once the voltage vc at both ends of the capacitor increases to equal to the power supply voltage V, vc = V, the capacitor is charged, no current flows in the circuit, and the charging process of the capacitor is completed.

Figure 3: The capacitor is charging
Since after the capacitor charging process is completed, no current flows through the capacitor, so in the DC circuit, the capacitor can be equivalent to an open circuit or R = ∞, and the voltage vc on the capacitor cannot change suddenly.
When the connection between the capacitor and the power supply is cut off, the capacitor is discharged through the resistor RD, and the voltage between the two boards will gradually drop to zero, vc = 0, as shown in Figure 4.

Figure 4: The capacitor is discharging
In Fig. 3 and Fig. 4, the resistance value of RC and RD influence the charging and discharging speed of the electric capacity respectively.
The product of the resistance value R and the capacitance value C is called the time constant τ, which describes the charging and discharging speed of the capacitor, see Figure 5.

Figure 5: Voltage vc and current iC during charging and discharging
The smaller the capacitance value or resistance value, and the smaller the time constant, the faster the charging and discharging speed of the capacitor, and vice versa.
Capacitors exist in almost all electronic circuits, and it can be used as a "fast battery". For example, in the flashlight of a camera, the capacitor acts as an energy storage element to quickly release energy at the moment of the flash.