The theory behind a double boiler is that you will occasionally want to heat something, but very gently. When you make hollandaise sauce, you want to warm the egg yolks ever so slightly. This improves their ability to form an emulsion.
But if you heat them too much, they'll actually lose their emulsifying properties. And if you really get them too hot, the proteins will curdle and you'll end up making scrambled eggs.
Similarly, when you're melting chocolate, heating it directly can affect its texture, which again has to do with the fact that chocolate is an emulsion of cocoa solids, fat, and sugar.
With a double boiler, instead of the ingredients going into a pan on the stovetop directly over the heat source, we bring some water to a simmer in the pot, and then fit a glass or metal bowl over the top of the pot. The steam from the simmering water heats the contents of the bowl.
When you do this, make sure the bottom of the bowl doesn't come into contact with the simmering water. There should be a gap between the water and the bottom of the bowl. Don't underfill the pot, however, because if all the water boils away, you'll just be heating a dry pan, which could damage it.
The photo above shows a bowl of raspberry curd being gently heated over a pot of hot water. Raspberry curd is a lot like hollandaise sauce, but with sugar and puréed raspberries added. Essentially, though, it's an emulsion of butter and egg yolks, which is why it's prepared in a double-boiler, just like hollandaise.
You can purchase a dedicated double boiler insert, which is basically a metal colander without any holes in it. It has a handle, and the bowl is tapered so that it will fit over many different sizes of pans, and it has spouts to make pouring easier.
You can also get a double boiler set, where you get the pot and a flat-bottomed insert that fits into it, along with a lid that fits both the pot and the insert.
You can even use a smaller pot that fits into the larger one underneath, but this can be awkward since you have to hold the upper pot steady, so that it doesn't tilt over, leaving you only one hand for doing everything else.
It'll work in a pinch, however, and the store-bought options are fine. But if you already have a pot and a stainless steel or glass bowl, that's really all you need.