When an empty (discharged) capacitor is connected to a battery, it slowly charges up as one plate fills up with electrons, while the other plate has electrons drawn away from it towards the positive terminal of the battery, resulting in one plate having a positive charge and the other having a negative charge.
A battery stores electrical energy and releases it through chemical reactions, this means that it can be quickly charged but the discharge is slow. Unlike the battery, a capacitor is a circuit component that temporarily stores electrical energy through distributing charged particles on (generally two) plates to create a potential difference.
As charge flows from one plate to the other through the resistor the charge is neutralised and so the current falls and the rate of decrease of potential difference also falls. Eventually the charge on the plates is zero and the current and potential difference are also zero - the capacitor is fully discharged.
When a capacitor charges, electrons flow onto one plate and move off the other plate. This process will be continued until the potential difference across the capacitor is equal to the potential difference across the battery. Because the current changes throughout charging, the rate of flow of charge will not be linear.
When a voltage is placed across the capacitor the potential cannot rise to the applied value instantaneously. As the charge on the terminals builds up to its final value it tends to repel the addition of further charge. (b) the resistance of the circuit through which it is being charged or is discharging.
As soon as the switch is put in position 2 a 'large' current starts to flow and the potential difference across the capacitor drops. (Figure 4). As charge flows from one plate to the other through the resistor the charge is neutralised and so the current falls and the rate of decrease of potential difference also falls.