With small apertures the edges of the diaphragm blades can bend and disperse light waves just before they reach the film. This diffraction effect results in a loss of resolution and sharpness and is common at the two smallest f/stops of a lens.
This graph shows a sample result for a typical 1:2 45mm prime lens. The Y axis (vertical) is sharpness, excellent at the top and poor at origin. The X axis (horizontal) represents the center of the image at origin and extends to the image corners.
The graph lines show that the lens wide open at f/2 is almost as sharp as f/8 in the center but deteriorates more dramatically towards the corners. Stopping down improves sharpness across the frame even at f/2.8. The resolving power of this lens is best at f/4, which gives the sharpest results, just above f/5.6. The images start to level off throughout the frame at f/11, but this is the point where diffraction starts to have an impact, and sharpness is worst at the smallest aperture, f/16.