I asked myself such questions in the late 70's when I was studying the subject of Theoretical Electrical Engineering... where they unsuccessfully tried to “explain” me this phenomenon through strict definitions. I remember what I could not imagine was why as the current went down, the voltage on the capacitor kept rising. Many years later, in an interesting conversation with my former students and followers… and by the help of the hydraulic analogy, I finally managed to figure out what was really going on...
After the main question why the voltage across a capacitor lags the current through it, another logical question arises, "And why is this lag exactly 90 deg in the single capacitor and less than 90 deg in the RC circuit"? Here are possible intuitive explanations (such as I would like to hear years ago).
1. Single capacitor. I have come to the conclusion that textbooks fail to explain the phase shift between the current and voltage since they consider the case of a voltage-supplied capacitor. But this arrangement (an AC voltage source directly drives a capacitor) is fundamentally incorrect (like the case where a voltage source directly drives a diode)... although it is still used to make a voltage-to-current differentiator. But what is more important to us is this arrangement is not suitable for an intuitive explanation of what is happening.
The dual arrangement - current-supplied capacitor, can help us easily explain why voltage lags the current with exactly 90 deg. In this arrangement, an AC current source drives the capacitor that now acts as a current-to-voltage integrator. "Current source" means that it produces and passes sinusoidal current through the capacitor in spite of all. No matter what the voltage across the capacitor is - zero (empty capacitor), positive (charged capacitor) or even negative (reverse charged capacitor), our current source will pass the desired current with desired direction through the capacitor. So the voltage across capacitor does not impede the current (it tries... but the current source compensates it by increasing its internal voltage).
Until the input current is positive (imagine the positive half-sine wave) it charges the capacitor and its positive voltage continuously increases in spite of the current's magnitude. The strangest here is that even when the current decreases to zero the voltage continues to increase to maximum (my amazement in the past). Then the current changes its direction and during the negative half-sine wave it charges the capacitor with an opposite polarity... and the magnitude of its negative voltage continuously increases in spite of the decreasing current's magnitude. So, in this arrangement, the phase shift is constant and exactly 90 deg because of the ideal input current source that compensates the voltage drop across the capacitor.
Hydraulic analogy. The popular "water vessel analogy" ("electrical current - water flow" and "voltage - water level") can help us fully understand in an intuitive way the phase shift idea.
First half wave (0 - 180 deg): Imagine you fill a vessel with water and picture graphically this process. Choose the half of the maximum water height as a zero level (ground) and begin gradually, in a sinusoidal manner, opening (in the interval 0 - 90 deg) and then closing (90 - 180 deg) the supply faucet. Note that no matter you close the faucet (in the interval 90 - 180 deg), the water level will continue rising. It is strange that you close the faucet but the water continues rising. Finally, you have completely closed the faucet (zero current), but the level of the water will be maximum (maximum positive voltage).
Second half wave (180 - 360 deg): At this point, you have to change the flow (current) direction to make the water level decrease. For this purpose, you can begin gradually opening and then closing another faucet at the bottom to draw the water (i.e., you draw current from the capacitor). But again, no matter if you close the faucet the water level will continue falling. It is strange that you close the faucet but the water continues falling. Finally, you have completely closed the faucet (zero current), but the level of the water will be maximum negative (maximum negative voltage).
So, the basic idea behind all kind of such storing elements (named integrators) is: The sign of the output pressure-like quantity (voltage, water level, air pressure, etc.) can be changed only by changing the direction of the input flow-like quantity (current, water flow, air flow, etc.); it cannot be changed by changing the magnitude of the flow-like quantity. At the final point, the current is zero but the voltage is maximum; this gives the 90 phase shift on the graph.
2. RC circuit (voltage-to-voltage integrator). We have already realized that it is incorrect to drive a capacitor directly by a voltage source; it is better to drive it by a current source. For this purpose, let's connect a resistor between the voltage source and the capacitor to convert the input voltage to current; so, the resistor acts as a voltage-to-current converter. Thus we have built a current source by the input voltage source and resistor. Let's now consider the circuit operation (I will do it electrically but the hydraulic analogy of communicating vessels is an impressive way to do it as well).
Imagine how the input voltage VIN changes in a sinusoidal manner. In the beginning, the voltage rapidly increases and the current I = (VIN - VC)/R flows from the input source through the resistor and enters the capacitor; the output voltage begins increasing lazy. After some time, the input voltage approaches the sine peak and then begins decreasing. But until the input voltage is higher than the voltage across the capacitor the current continues flowing in the same direction. As above, it is strange that the input voltage decreases but the capacitor voltage continues increasing. Figuratively speaking, the two voltages "move" against each other... and finally meet. At this instant, the two voltages become equal; the current is zero and the capacitor voltage is maximum. The input voltage continues decreasing and becomes less than the capacitor voltage. The current changes its direction, begins flowing from the capacitor through the resistor and enters the input voltage source. It is very interesting that the capacitor acts as a voltage source that "pushes" current into the input voltage source acting as a load. Before the source was a source and the capacitor was a load; now, the source is a load and the capacitor is a source…
The moment where the two voltages become equal and the current changes its direction is the moment of the maximum output voltage. Note it depends on the rate of changing (the frequency) of the input voltage: as higher the frequency is, as low the maximum voltage across the capacitor is... as later the moment is... as bigger the phase shift between the two voltages is... At the maximum frequency, the voltage across the capacitor cannot move from the ground... and the moment of current direction change is when the input voltage crosses the zero (the situation is similar to the case of current-supplied capacitor).
So, in this arrangement, the phase shift varies from zero to 90 deg when the frequency varies from zero to infinity. This is because of the imperfect input current source that cannot neutralize the voltage drop across the capacitor.
If we want the phase shift between current and voltage in the RC circuit to be exactly 90 deg regardless of frequency (as in the case of a single capacitor), we should somehow compensate the voltage across the capacitor. This is done by the operational amplifier in the circuit of the op-amp inverting integrator. It makes its output voltage equal to the voltage drop across the capacitor and adds it in series. The result is zero voltage (the so-called virtual ground).