My brother-in-law Tom and I were talking about depth of field yesterday. We disagreed - but it turns out we were both right. Tom said that the generally greater depth of field in compact cameras is a function of the smaller sensor size. I said that I thought that it wasn't the sensor size, but the smaller focal lengths of the lenses that matters.
Well, I've browsed around on the web this evening a bit and I have a clearer understanding now. Turns out these two things are pretty much heads and tails of the same coin. Wikipedia's article on depth of field puts it fairly succinctly:
To maintain the same field of view, the lens focal lengths must be in proportion to the format sizes. Assuming, for purposes of comparison, that the 4×5 format is four times the size of 35 mm format, if a 4×5 camera used a 300 mm lens, a 35 mm camera would need a 75 mm lens for the same field of view. For the same f-number, the image made with the 35 mm camera would have four times the DOF of the image made with the 4×5 camera.
If I get a few minutes, I'll borrow my daughter's compact Nikon and take a couple of test photos with it and my Pentax K10D. But the principle now seems fairly straightforward. The smaller the sensor, the smaller the focal length required to achieve the same field of view. This accounts for the so-called "crop factor" as a result of which the birds I photograph with my Pentax K10D and, say, a 300mm lens seem to be "bigger" (take up more of the photo's area) than they would if I use the same lens with a normal 35mm film camera, which has a larger image-capture area. But as we all know or at least think we know (see next paragraph), the shorter the focal length, the greater the depth of field, other things being equal. That's why portrait photographers use 100mm lenses and stand so far from their subjects: they're trying to reduce the depth of field. So as the sensor gets smaller, you need to use a shorter focal length to maintain the same field of view and thus the same depth of field. One of the reasons that the cheap compact cameras today so seldom take a "bad" (out of focus) photo is that their small sensors and short focal lengths give them extraordinary depth of field. I read an interesting note here observing that Ansel Adams and landscape photographers of his generation using large format cameras had to stop all the way down to f/64 (!) in order to achieve satisfactory depth of field - and even so, you can get greater depth of field today using a compact camera wide open. Looking it from the other direction, I would point out that it was the desire to be able to limit depth of field for creative purposes that was one of the main reasons why I switched to a DSLR.
Now I said above that the sensor-size explanation and the focal-length explanation are saying the same thing. Sorry, I lied. It turns out that Tom's explanation - that depth of field has to do with sensor size rather than focal length - is technically more correct. You don't have to read far into this article by Ben Long at creativepro.com to find out why. He provides examples of the same object photographed at two focal lengths. There is a city skyline in the background. In the picture taken at the shorter focal length, the city skyline appears to be sharper. In the picture taken with the longer focal length, there is a smaller field of view so you see less of the city skyline, and what you do see seems to be both closer and blurrier. But appearances are deceiving! If you ignore the foreground subject and examine one of the details in the background at the same size instead, you will be amazed - well, I was amazed - to discover that they are in fact equally fuzzy. The skyscraper in the background of the first photo (the one taken with the short focal length) appears to be in better focus only because it's relatively smaller as displayed on screen. So changing the focal length isn't really changing the depth of field. It's changing the field of view, and that in turn gives the appearance of changing the depth of field. Differences in depth of field really do derive from the size of the sensor.
On the other hand, as Ben Long quickly admits, as a practical matter, the focal-length explanation is more useful to working photographers, who after all, aren't going to change sensors in their cameras the way they change apertures or focal lengths.