Place a small amount of olive oil in a heated, nonreactive rondeau. Add the onions and garlic. Cook until the onions are tender. Season with salt and pepper. Allow to cool slightly.
Add the sugar, vinegar, salt and pepper in the rondeau. Bring to a boil. Simmer over low heat. Stir frequently. Simmer until liquid has reduced and mixture has thickened. It will burn easily at this point. Watch the mixture closely.
Season with salt and pepper. Allow to cool. Place in a storage container. Cover and refrigerate until needed.