Finding the aperture sweet spot of your lens can make a big difference in the sharpness of your photographs.
As you already know, the size of your aperture controls your depth of field. A smaller aperture (higher f‑stop) will give you greater depth of field (greater front-to-back sharpness), while a larger aperture (smaller f‑stop) will give you a shallower depth of field, with more blurriness in the background or foreground of your focal point.
There’s another important consideration in terms of sharpness. I saw an excellent example of this while taking some shots yesterday in Indianapolis.
Here’s a shot at f/25 (1/40 sec, ISO 100, handheld):
A smaller aperture is generally a good thing for landscape shots, to try to get as much of your picture in focus.
Now here’s the same shot at f/11 (1/30 sec, ISO 100, handheld):
I actually used an example with a slightly slower shutter speed, which would tend to increase any visible handshake.
The moral of the story: lenses have a sweet spot where the overall sharpness is higher. Take this into consideration when choosing your aperture. All else being equal, choose an aperture at that sweet spot. Experiment with your lenses to find out where that sweet spot is.