Capacitors are the energy storing devices, this energy is stored in the form of an electric field that is developed between the plates of the capacitor.
Initially, this energy is supplied to the capacitor using a voltage source and this process is called charging, discharging is the process of withdrawing the previously stored energy from the capacitor is called discharging of the capacitor.
Energy stored in a capacitor is expressed as 
E = ½ CV2
E = Energy stored
C = Capacitance
V = Voltage
When a capacitor is connected across a voltage source (V), positive and negative charges start to accumulate on the capacitor plates, and during the process, a current flows through the circuit due to movement of electrons, this current is called charging current. This charging of the capacitor is never instant, the charging process requires a certain amount of time (T) to complete.
However, to charge a capacitor if it is directly connected across a voltage source it will try to charge instantly, and for that infinite charging current has a flow and we know that voltage sources can only provide a finite amount of current. Directly charging a capacitor can cause damage to the capacitor or source due to burnout.
Practically there is always some resistance present in the circuit which may be due to the leads of the capacitor or due to the wire connecting the capacitor to the charging circuit. Thus there is always an RC circuit that limits the current flow and some finite time is required for the charging of the capacitor. This time is called the RC time constant (T=RC). In an RC circuit, capacitors are fully charged after 5T.
Now suppose we have a fully charged capacitor, this capacitor can be thought of as a battery. What would happen if we short the anode and cathode of a battery? According to ohm’s law an infinite amount of current will flow through the circuit which is a safety hazard.
Discharging a capacitor is essentially a flow of current out of a capacitor. Big capacitors that have large amounts of energy stored in them can be potentially dangerous and can cause injury or even can cause death in some cases if not handled properly.
When the terminals of large capacitors are shorted, it will cause an infinite amount of current to flow and the capacitor will try to discharge instantly which can cause spark or fire. Since resistance is present in every wire or lead of the circuit some amount of resistance will always remain present in the circuit which will slow the discharging process and only a finite amount of current will flow to the discharging circuit.
A properly prepared RC discharging circuit will let the capacitor to completely discharge after 5T. It is recommended to have a resistor in the discharging circuit due to above-mentioned reasons otherwise chances of injury by accident remain there.