The aperture your lens is set to controls how much light hits your sensor for the duration of the shutter speed and has an effect on the depth of field, but there’s also another way it affects the image – diffraction. Light is scattered as it passes close to the aperture blades, so the narrower the aperture the greater this effect – the result is a softening of image detail. So it’s suggested you avoid very narrow apertures. The smaller the size of an image sensor, the more obvious the effect. With a large full-frame sensor, diffraction becomes enough of an issue for image quality to lessen beyond around f/16, while on a DX sensor it’s about f/11.
But it’s not all bad. The scattering turns points of light into an attractive starburst in night photography, and the softening effect is less noticeable in dark scenes.