Diffraction
Simulator
AI generated demo image
Why f/22 is softer than f/8
Stopping down fixes the faults in a lens right up to the point where it starts causing a different one. Light bends around the edge of the iris, and the smaller the hole the more it spreads.
The Airy disc
A point of light does not land on the sensor as a point. It lands as a small disc with rings around it, and the width of that disc is set by the f-number alone, about 1.3 microns for every whole stop of f-number, whatever lens or camera you put it on.
Aberrations go the other way
Spherical aberration, coma and field curvature are all worst wide open and improve quickly as the iris closes. Diffraction grows steadily. Add the two together and there is a minimum somewhere in the middle: the sharpest aperture that lens has.
Usually two or three stops down
A fast prime is normally at its best around f/2.8 to f/5.6, a cine prime a little wider, a kit zoom a little further down. If you only remember one thing, it is that wide open and fully stopped down are both soft, for completely different reasons.
Pixel pitch decides when you notice
Diffraction is happening at every aperture; it only becomes visible when the Airy disc is bigger than a photosite. A small, dense sensor hits that point several stops earlier than a large one, which is why the same f/11 is fine on one camera and mush on another.
Depth of field is still worth buying
Being diffraction limited is not a failure, it is a trade. If f/16 is what holds the shot together, take the softness and light it so you can. Just do not stop down past what you need in the belief that it is getting sharper.
Sharpening cannot undo it
Diffraction removes detail rather than blurring a copy of it, so there is nothing left to recover. Sharpening a diffracted image raises the noise and the haloes and leaves the resolution where it was.