Please note that for all example images, the lens used had a maximum aperture of f/4.8. The biggest aperture size of your lens may differ. All photos were shot with a 70-300mm telephoto lens at a 195mm focal length. The “camera view with DOF button held” images are there for demonstration purposes only to give you an example. In reality, pressing DOF preview button with an aperture of f/29 would limit the light entering the lens so much, you would not be able to see anything through the camera.
First let us start by gaining an understanding of what Depth-Of-Field (DOF) really is. I myself do not have a firm grasp on the technical aspects so cannot explain exactly how it works, but can tell you what DOF is, the effect which is given, and how to control it. Depth-of-field is the field of reasonably sharp parts of your photograph. In other words, it is what will be in focus and sharp and not out-of-focus/blurred. All parts of your image with a good amount of sharpness is within the range of your depth-of-field. All parts of your image outside the depth-of-field will be seen as blurry or out-of-focus.
Bokeh is the out-of-focus areas of the photograph. More precisely, it is the quality of the out-of-focus elements in your photo. When you take a photo and the background is blurred, it will have some degree of bokeh for your background. When you have a lens with good construction, the Bokeh tends to look smooth and creamy. A lens on the reverse side, will not have as nice of a blur.
Depth-of-field most commonly may be controlled in three ways and will be determined by your lens focal length, camera settings, and position between you and your subject in relative distance to your background. A short (wide-angle) lens will give you a great distance of depth-of-field and if you use a long lens (telephoto), you may minimize your depth-of-field. A greater depth-of-field means you have more in focus. Example, if you want to go for max blurriness, you would use a telephoto lens. The greater the focal point, the shallower depth-of-field you can achieve.
Distance between you and a subject in relative location to your background may also play a part in your DOF. For example, using a lens with a focal length of 200mm and standing 50 feet away from your subject will give you a larger depth-of-field than standing 10 feet away. Standing 10 feet away would give you a very shallow depth-of-field. The longer the focal length and shorter distance to your subject reduces the DOF. With that said, let us say we took at very short focal length, such as a 20mm lens and stood very far from our subject. This would give a very deep DOF with a huge area in focus.
The other way to control your DOF is by adjusting your camera aperture setting. A low aperture value, say around f/2.8 will allow a lot of light into the camera. This has a few effects but for this discussion, it deals with giving a shallow DOF. On the flip-side, if you were to raise your aperture to around f/11, you are will be stopping down and allowing less light into the camera. The effect of a large aperture setting (smaller opening) gives a higher DOF, allowing more of the background to remain in focus.
Using your cameras DOF button gives a preview of exactly what you have in focus with your DOF, and what is out-of-focus and has fallen to the Bokeh gods. Pressing this button adjusts the lens to your current aperture setting so what you see through the view-finder is exactly what the lens sees when taking your exposure. Normally on a DSLR when you look through your viewfinder or live-view, you are seeing what the lens sees while wide-open (largest aperture). The camera remains this way unless you use the DOF preview button and tell your camera to allow you to look through the lens at your requested aperture. When pressing the DOF button, you will see everything which is in focus, and is not in focus. If your aperture is set to a low number like around f/2.8, you will not notice much of a difference, if any. This is what the camera normally shows you. However, if you set your camera aperture to a high value, such as f/11, this is where you will start noticing an effect.
With your camera aperture set at f/11, pressing the DOF preview button will change the camera to show you the actual view through the lens with that aperture. One thing you will notice is the view will become darker. This happens because the aperture becomes so small and lets such little light into the camera, it is difficult or impossible to see anything. As you increase your lens aperture, using the DOF button will start making the viewing through your view-finder much more difficult. Slowly everything will become darker and darker as your aperture value increases. When you set your aperture setting too high, pressing the DOF button may only show you darkness. While the image may get darker, there is also a change of what you are seeing. You will now see what is actually in focus and what is not. With the DOF button pressed, some of what may have looked blurry and out-of-focus previously, might actually now be in focus. Letting go of the DOF preview button again may change what you are seeing through the camera back into more of a blurry photograph, but when that shutter is snapped, your camera will take a photo using the aperture set and should look exactly as you seen with the DOF preview.
One of the best ways to see this in practice, is by taking your camera outside and finding a small tree, hedge, area of rocks, or flower garden. Set your camera to manual mode or aperture priority and set your camera to an aperture of f/11. Use a long lens (telephoto) and zoom in as much as possible, focusing on a close object. You should notice the surrounding area of what you are focused in on is a bit blurry, correct? Now, press the DOF preview button on your camera. Try to ignore how the brightness of what you are seeing changes and instead pay attention to the sharpness of the surrounding area. You can go ahead and let go of the button and press it again. Do this a few times until you see the change. Using the DOF button shows you what exactly is in focus, and what is not.
Why is this important? Sometimes it is not important and depending what you are photographing and how you have everything setup, you may not notice any change. In photography where you are deliberately adding some Bokeh to your shots and especially in macro photography, it is good to see if your subject is fully in focus or if your subject is partially out-of-focus. It is good to see if your background is in focus or how out-of-focus it really is. In the end, the true function of this button is only to show you exactly what is in focus and what is not with the given aperture setting, and that is all.