Phase shift in a transformer occurs due to the magnetic coupling between the primary and secondary windings. When alternating current flows through the primary winding, it creates a magnetic field that induces a voltage in the secondary winding. This induced voltage is not in phase with the primary current due to the reactance of the windings and the core’s magnetic properties. The amount of phase shift depends on the transformer’s turns ratio and load conditions, affecting power transfer and system stability.