Again, a major part of your decisions when taking a photography will be about how to capture the scene. If you have a fast subject, you could freeze the action, or blur the action depending on the shutter speed setting you choose. If you have a portrait or a landscape, you can choose to have most everything sharply focused, or have only one subject sharp while the background and foreground are blurry.
When you have your camera on A, Av, or Aperture Priority, when you choose the aperture that will create the Depth of Field you want, your camera will automatically choose a different shutter speed to accomodate the aperture you have chosen. They are generally set up so each aperture change is half or twice as much light entering the camera, while the shutter speeds are set up so that each change is twice or half as long of exposure time. In this way they can be interchanged to create the same exposure through different combinations.
When you choose a specific aperture setting, your camera will have to accomodate it and the lighting in your scene by choosing a corresponding shutter speed that allows the camera to get the right amount of exposure. When you choose a specific shutter speed, your camera will accomodate it by choosing a corresponding aperture that will provide the right amount of exposure depending on the lighting in the scene.
These are all equal:
1/30 @ f/2.8
1/15 @ f/4
1/8 @ f/5.6
1/4 @ f/8
1/2 @ f/111 @ f/16
How does the camera know?
So how does the camera know what is the correct exposure? The light meter in your camera is designed to "see" grey. A certain grey that reflects exactly 18% of the light that hits it. The meter is calibrated for this brightness and so is your film. Let's just say that it is a grey that is exactly in the middle between very bright and very dark. The idea is that the meter will (in most situations) be able to get the right setting by averaging out all the tones in the scene you're pointing at. In some cases, however, the scene you're looking at will not be the average scene with equal amounts of black and white. In these cases, the meter may get fooled by the brightness or darkness of the scene and give you the wrong exposure setting. A good example of this is a situation where you have a person sitting in front of a bright window.