To cook it, you heat up some olive oil in a pan, but not searingly hot, throw in the onions and a big pinch of salt, the herbs, and the unpeeled garlic cloves. Stir it often. Keep the heat lower than a normal sautee, like medium. When you see the onions go completely limp and translucent, turn the heat down even more because you want to achieve a very slow even caramelization without getting charred bits. The ultimate goal is to, well, melt the onions into a savory, sweet, limp mass of golden brown awesomeosity. This will take a while, like an hour. Do it while you're doing something else in the kitchen, stirring every so often to prevent burning.
Once the onions have achieved savory, sweet, limp, golden brown awesomeosity, it's up to you to decide what you want to do with them. You can leave them as they are and fill a smallish prebaked tart crust, topping it with some good anchovies and oil-cured olives for a pissaladiere nicoise. You can add a bunch of red wine into the onions, reducing it into an onion jam which is amazing with brie on whatever bread/cracker product you have lying around. Or you can dump them into mashed root vegetables to amazing effect. I mashed up a small rutabaga, a couple potatoes, and a few carrots and then dumped the onions in. It is extremely delicious. Melted onions are apparently also the base for onion soup, which I am oddly embarrassed to say I've never made.
The trick of leaving the garlic unpeeled prevents burning. Garlic burns much more easily than onions, and by leaving it in its paper, you get the garlic flavor with none of the burned bitterness. You can peel them after the onions are done and either eat it plain (because by this time, it's sweet and soft) or just give it a light chop and fold it into whatever you're making. Whatever you decide to do, melted onions are a lot of flavor for very little money and there's no cream or bacon involved. As far as flavor vectors go, it's healthy, vegan-friendly, and tastes awesome.