How is the sharpness of the image affected by the size of the aperature?

The smaller the aperture, the sharper the image. If your question is WHY that happens, hopefully another contributor will help out with that answer.