Caramelized onions are delicious, and add a depth of sweet flavour to foods that can't be matched. They're easy to make, too, if you're patient, for the creation of beautiful, mahogany-coloured onions takes time: 45 minutes to 1-1/2 hours, depending on the onions, the skillet, the method used, and the stove.
Any type of onion, including shallots, can be used to make caramelized onions, but a sweet variety like vidalia works especially well. This isn't surprising, because what you're doing when you cook the onions is first to evaporate the naturally occurring sulphur compounds (which make your eyes water) and then to break down the complex carbohydrates into sugars. Sweeter varieties of onions just have more carbohydrates in them to begin with.
A good skillet is also important, preferably one with a heavy bottom to better conduct the heat. The skillet should be big enough that the onions are not too thick in the pot, no more than an inch deep, for best results. Note too that the original volume of onions that went in the skillet is not what you'll get out: they'll shrink to perhaps a quarter of their original size. Perhaps a pound of raw onions will yield about a cup of caramelized onions. So start with lots.
There are basically two types or textures of caramelized onion: crispy and mushy. The former are wonderful sprinkled on a just about anything, while the latter make a fabulous addition to soups and gravy as well as a mean caramelized onion pilaf. This is just off the top of my head; once you get addicted, you'll think of thousands of uses for your caramelized onions.
Both varieties begin in the same way: with a little fat heated over a low heat in your skillet. I usually fry my onions in olive oil, but you can use any kind of oil you like, or butter, or a mix of the two. Heat the oil or whatever, and then add your onions, chopped or sliced. (Chopped will probably cook a bit faster, but crispy rings look nice on top of a plate of food.) For the mushy variety, start out the process with the lid on the skillet to keep the moisture in, then remove it about halfway through cooking; for crispy, no lid at all.
Don't let the heat go over medium; I keep it on low to medium low. Take your time; keep it slow. I was always taught that you should leave the onions in the skillet without stirring for up to half an hour, and then, as best you can, try to flip the onion mass over in chunks to cook on the other side. I know some people stir away, but that's not what I was told, and my onions brown beautifully, so I'm doing as I was told (for once).
Sprinkling a little sugar or pouring a little apple juice, apple cider, or balsamic vinegar over the onions after they have softened will speed the process slightly. They won't be as good, though.
I generally use all my caramelized onions the day I make them. Some say you can refrigerate them for up to six weeks, but read flavored oil and botulism for a rather more cautious view.
twofourtysix says a good combination is red onions and juniper berries. I've never tried it, but s/he assures me it is delicious!