Notice also that the shutter speed changed as you stopped down your lens. At f/1.8 you needed 1/6000th of a second to keep the light from overexposing your image. A large, fast aperture lets in a LOT of light, so you can only let it in for a short time -- by using a fast shutter speed. As you stopped down to f/8, your shutter speed moved to 1/500th of a second.
50mm f/1.8 non-D AF Nikkor
The aperture opening is smaller at f/8 than at f/1.8 and less light is getting in through a smaller opening, so the light needs to come into the camera for a longer period of time. 1/500th of a second is a much longer time than 1/6000th of a second.
Then, notice how your shutter speed dropped to 1/40th of a second when you stopped down to f/22. At f/22 very little light is coming into the camera, so you have a long shutter speed at 1/40th of a second.
As you make the aperture opening smaller (f/22), you must let the light come in longer. As you make the aperture opening larger (f/1.8) you must let the light in for much less time. Does that make sense?
Aperture => Quantity of Light
Shutter Speed => Duration of Light
These two things work together to help you control the exposure and look of your image. With a fast aperture (large opening, f/1.8) you have very little depth of field, so you can isolate your subject from her surroundings. With a slow aperture (small opening, f/22) nearly everything in the image is in focus.
Experiment with your camera in M (Manual) or A (Aperture Priority) modes and learn how these relationships affect depth-of-field and the subsequent image's appearance.
Keep on capturing time...
More articles that might interest you