To get good glazed onions you want:
A good pan will distribute the heat evenly. Anything with a thick bottom is preferable, and cast iron is excellent. Using sufficient oil helps keep the onions from sticking over a long cook time. Moderate heat will keep them from burning. Patience will keep you from stirring them too often. They need to sit to develop color.
Remove the root and other end of the onions and cut them in half. Slice them and separate the rings, ending up with a bunch of half-moons of varying sizes.
Heat the pan, then add oil. When it's hot but not smoking, add the onions. Preferably you'll have only two layers. You can get by with a bit more, but too many will be a chore, as the ones on the top won't get much heat and the project will progress very slowly.
Turn the heat to medium and let the onions sit until they develop some color. Don't rush to flip them. When they seem ready, turn them, trying to get the more raw ones on the bottom.
Continue occasionally flipping them until you get the amount of caramelization you're looking for, or thereabouts.
Then add your sweet liquid. Simmer until the liquid has been mostly driven off, leaving the onions lightly glazed.