Current entering/leaving a capacitor is proportional to the change in voltage applied across its plates.
Lets say I have a capacitor in series with a DC power supply, a resistor, and an open switch. Once I close the switch, the voltage across the capacitor is equal to the voltage supplied by the DC source, but this voltage remains constant since DC power supplies are obviously constant.
This is all under the assumption that all components are ideal. I know that for current to enter the capacitor, the voltage across it has to be changing, which is what happens in the real world. Where does this change in voltage come from?