Prepare the onions: Peel and thinly slice the red onions into rings, about ⅛-inch thick. A mandoline works well for uniform slices, but a sharp knife does the job too.
Sterilize the jars: Wash pint jars, lids, and bands in hot, soapy water. Rinse well. Place jars in simmering water or run them through the dishwasher on a hot cycle to sterilize. Keep jars warm until ready to fill.
Make the brine: In a medium saucepan, combine the vinegar, water, sugar, and salt. Bring the mixture to a boil over medium-high heat, stirring until the sugar and salt are completely dissolved. Reduce heat to low and keep the brine hot while you prepare the jars.
Pack the jars: Working with one jar at a time, place 1 clove of garlic, 1 sprig of thyme, ½ teaspoon mustard seeds, and ½ teaspoon peppercorns into the bottom of each sterilized jar. Tightly pack the sliced onions on top, pressing them down gently to reduce air pockets and make room for more onions. Leave about ½-inch headspace at the top of the jar.
Add the brine: Carefully ladle the hot brine over the onions and spices in each jar, making sure all the onions are fully submerged. Maintain ½-inch headspace.
Remove air bubbles: Run a bubble remover or butter knife along the inside edges of the jar to release trapped air. Add more brine if needed to maintain proper headspace.
Seal the jars: Wipe jar rims clean with a damp cloth to ensure a good seal. Place lids on top and screw bands down until fingertip tight.
Water bath process: Place filled jars into a prepared boiling water canner, ensuring jars are covered by at least 1 inch of water. Return to a boil and process for 10 minutes (adjust for altitude if necessary).
Cool and store: Carefully remove jars from the canner and set on a towel-lined surface. Let them cool undisturbed for 12–24 hours. Check seals before storing. Any unsealed jars should be refrigerated and eaten first.