There are a few culinary setups that can more or less correctly be referred to as a bain-marie (pronounced "bane mah-REE").
But in every case, it has to do with using a container of hot water to deliver indirect heat, or steam, or both.
Probably the most common application, and if I had to choose one definition of the term it would be this one, is the kind of setup used for making crème brûlées. In this system, the uncooked custards are poured into individual ramekins, and then these ramekins are arranged in a larger baking dish.
Hot water is poured into the larger dish so that it comes to about halfway up the outsides of the ramekins. Then the whole dish is transferred to the oven and baked.
By producing steam, which heats the tops of the custards more gently than dry hot air would do, this technique helps prevent the tops of the custards from cracking.
You can use this technique to cook cheesecakes, which, being custards, are also prone to cracking on top and also benefit from moist air in the oven.
The only thing is, cheesecakes are generally baked in something called a springform pan, which is a two-piece contraption that allows the base and the sides to come apart, making it easier to get the cheesecake out of the pan.
And the downside to immersing a springform pan in water is that it can leak, and the cheesecake can get waterlogged. Some people will try to seal up the bottom of the springform with foil, but it's not a foolproof workaround by any means.
Instead, when baking a cheesecake, I recommend placing the pan of water on the lower shelf of the oven and the springform on the upper shelf. That way the steam will still envelop the top of the custard without any chance of water seeping into the cheesecake.
Another setup that sometimes goes by the name of bain-marie is really more of a double-boiler.
A system like this involves a pot of hot water simmering on the stovetop, and then a bowl or insert situated above the pot. Usually something like this is used for transmitting gentle heat, like when you're melting chocolate or making hollandaise sauce.
With hollandaise, which is made by stirring melted butter into beaten egg yolks to form an emulsion, it warming the egg yolks helps them to absorb more butter. But getting them too hot will cause the eggs to curdle, giving you scrambled eggs. Whisking them over a double-boiler (or bain-marie, if you will) warms them just enough, but since the heat is indirect, it's less easy to curdle them.