As far as I can tell, the terms double boiler and bain marie mean more or less the same thing. For this article, I'm going to use them interchangeably.
An important distinction, however, is whether the upper pan touches the water.
When cooking this way, the heat has to travel through the steam before it can affect the food. The benefit is that this is an extremely gentle way to apply heat. This makes it useful when tempering chocolate, or emulsifying sauces like hollandaise. The drawback is that it's not possible to vary the temperature much — the water must be at a constant 100°C in order to produce steam, and the only way to vary the temperature is to control whether the water is at a simmering boil or a rolling boil. (of course, the cook is also able to control how long the food is cooked)
When cooking this way, the heat transfer is much higher, because it doesn't have to travel through the steam any more. However, because the water no longer is required to produce steam, the cook is free to choose any water temperature from 0° to 100°C. †
This is often used when cooking custards.
The role that the water plays here is very different. In configuration 1, the water exists only to produce steam. Here, the water acts as a thermal buffer or thermal mass — this means that the food's temperature will change fairly little, unless a lot of heat is applied. The benefit of this is that the food's temperature will be more stable. The drawback is that initially bringing the water up to temperature will take a longer time, relative to cooking in a single pan.
The volume of water in this configuration is very important — the more water there is, the slower it will be for changes in temperature to happen. The cook will want to be deliberate in deciding this: use just enough water to get the desired amount of stability, but not so much as to unnecessarily lengthen the total cooking time.
This is often called a "dry heat" bain marie.
When there's an air gap between the two pans, heat transfer occurs via thermal radiation between the two pan surfaces (like how a heat lamp works), and convection due to movement of air in the gap.
These are often used to keep food warm within commercial food serving stations.
For configurations 2 and 3, I like to use three silicone spacers to support the upper pan. Traditionally, a wet towel is placed below the pan, but I feel that a towel will inhibit convection currents and potentially lead to hot spots. (Three spacers is the best option, because a four-legged stool can rock while a three-legged stool can not).
It's good for the silicone to be at least boil-safe, if not food-safe. I cut pieces off of rolling pin guides for spacers thinner than ¼", and I cut slices out of an [unused] boil-safe silicone dildo for spacers thicker than ¼". (don't judge; I couldn't find another thick piece of silicone to buy and slice up)
When the heat must travel through the steam, the reason that the food heats more slowly is because the thermal conductivity of water vapor is much lower than that of liquid water (~0.0267 versus ~0.606 W∕m⋅K, respectively).
For configuration 2, the water acts as a thermal mass.
† and temperatures higher than 100°C can be achieved if the water is replaced with oil