These sweet-and-sour onions are often part of Italian antipasti, served warm or at room temperature.
Bring a large pot of water to a boil. Add onions; reduce heat to medium-low. Simmer onions until tender, 25 to 30 minutes. Drain; let cool. Peel onions.
Heat oil with bay leaf in a large saute pan over medium heat until hot but not smoking. Add thyme. Add half of onions; cook, stirring, until deep golden brown in spots, about 5 minutes. Transfer to a bowl with a slotted spoon. Repeat with remaining onions. Add first batch to pan.
Stir together vinegar, wine, sugar, and salt; add to pan. Reduce heat to medium-low. Cook, stirring occasionally, until liquid is syrupy and glazes onions, 20 to 25 minutes. Season with pepper.