Aperture and maximum Sharpness
The reason is an effect called diffraction and would require an excursus to physics to explain it.
This effect is independent from the depth-of-field described before. Depth-of-field is about the distance range that is in focus; the maximum sharpness in this chapter is about the sharpness you can get in the distance where the camera has focused.
It depends on your lens when this effect gets visible. My rule of thumb for DSLR cameras with the common sensor size of about half of a „full frame“: With f-numbers 8-11 you get best sharpness, with higher numbers it will decrease.
At small f-numbers other optical effects can decrease sharpness and image quality so with f8 or f11 you will very likely make the best choice with regard to image sharpness.