When alternating current flows through resistors they do not cause any change in the voltage phase.
When you plot the current and voltages everything is nicely syncronised . . .
However, add the effects of a capacitor (which has to rapidly charge and discharge) or an inductor (with induced emf from its changing magnetic flux) and the result is voltage phase shifts across those components. Fortunately it is all predictable . . .
Adding a capacitor to the circuit causes the voltage across it to get out of phase with the current.
Voltage and current get out of phase because the capacitor constantly charges and discharges and the voltage across it depends upon the quantity of charge on the plates at any instant in the cycle.
When constantly charging and discharging, the current is at its maximum when the capacitor is dicharged (i.e. when Vcapacitor = 0). As the capacitor plates charge the voltage across it increases until the capacitor voltage peaks and it momentarily stops changing. At that point Vcapacitor is maximum and the current is zero.
The overall result is the 90° phase shift in the voltage across the CAPACITOR where the CURRENT leads the VOLTAGE .
Adding an inductor to the circuit also causes the voltage across it to get out of phase with the current . . .
This happens because energy from the changing magnetic field in the inductor induces an emf to oppose the changes in current (Lenz's Law).
The resulting induced voltage forces the current to lag a quarter-cycle (90° phase shift) behind the inductor voltage.
As the current tries to increase, the induced back-emf across the inductor opposes the rise in accordance with Lenz's Law. When the current tries to decrease, a forward-emf is generated to maintain the flow. Because of this continuous resistance to change, the current wave peaks a quarter of a cycle after the voltage wave. in other words: The VOLTAGE leads the CURRENT for an INDUCTOR.
Use CIVIL to remember this . . .
Capacitor - Current Leads Voltage
Inductor - Voltage Leads Current