A common PC complaint is a brief freeze the first time a new effect, weapon or area appears. The cause is usually shader compilation happening at the worst possible moment.
What a shader has to become
A shader is a small program that runs on the graphics processor to decide how surfaces are lit, coloured and distorted. Games contain thousands of them.
Developers ship these programs in an intermediate form rather than as finished machine code. The final translation depends on the specific graphics hardware and driver present.
That translation is compilation, and it is real work. Complex shaders take meaningful time to compile even on fast processors.
Consoles avoid the problem by construction
A console has one hardware configuration, so shaders can be compiled during development and shipped ready to run. Nothing needs translating on the player's machine.
PCs have an enormous range of graphics hardware and driver versions, and a build compiled for one combination is not valid for another. The work must happen locally.
This is why the same game can be smooth on a console and stutter on a considerably more powerful PC.
Timing is what turns work into stutter
If compilation happens when a shader is first needed, the frame that needs it cannot be drawn until the work finishes. The picture holds while the processor catches up.
Because new effects appear during action rather than during quiet moments, the freeze lands exactly where it is most noticeable.
The work itself is not large in total. Its distribution is the problem, concentrated into single frames instead of spread across idle time.
Precompilation moves the wait rather than removing it
Many games now compile shaders during a loading step before play begins. The total time is unchanged but it happens once, in a place where waiting is expected.
Doing this well requires knowing which shaders will be needed, which means collecting that list during development and shipping it with the game.
Incomplete lists produce partial coverage, which is why some titles precompile and still stutter in less common situations.
Caches are more fragile than players expect
Compiled results are stored on disk so the work is not repeated. That cache is tied to the driver and hardware it was built against.
A driver update invalidates it, which is why a game that ran smoothly can stutter again after an unrelated graphics update.