Shooting at different apertures gives you different DOF. In addition, sharpness may vary across aperture. Lens may be soft wide open and diffraction may set in at very small aperture.
There are other issues like flare, CA, star burst effect and stuffs.