Early-Z
The GPU runs the depth test before the pixel shader instead of after, so occluded fragments are discarded without ever executing their expensive shader.
In the classic pipeline the depth test comes last, after the fragment shader has computed a colour — meaning you pay for the shader even when the fragment turns out to sit behind something else. Early-Z moves the test ahead of the shader whenever the hardware can guarantee the same result. GPUs gained it around 2001–2002.
The catch is that the shader must not write its own depth or use discard or an alpha test, because then the depth isn't known up front and the hardware falls back to the late test. That's why engines run a z-prepass to fill the depth buffer first, letting early-Z throw away the maximum amount of overdraw in the colour pass.