Combine the flour and ¼teaspoon salt in a bowl and, using your hands or a pastry cutter, quickly work in the butter, squeezing or cutting it until the floury mixture is filled with pea-sized lumps. Drizzle 3 tablespoons ice water over the mixture and stir with your hands or a fork until it just holds together when squeezed. Add the remaining water if necessary.
Gather the dough into a ball and flatten slightly, then wrap well in plastic wrap. Refrigerate for at least 1 hour and up to a couple of days.
Bring a pot of water to a boil. Drop the onions into the water and blanch for about 30 seconds. Drain well and run under cold water. When cool enough to handle, peel and trim them.
Heat the butter in a heavy 10-inch skillet, preferably cast-iron, over moderately high heat. When the butter has melted and foamed, sprinkle the sugar evenly over the bottom of the pan, followed by ½ teaspoon salt.
Lay the onions in the skillet and cook, without stirring, for about 8 minutes. Give the skillet a shake to jostle the onions around a bit then continue cooking until nicely browned all over, another 4 to 5 minutes. Don’t worry if the onions are not fully tender; they will continue to cook in the oven.
Drizzle the vinegar over the onions then scatter the thyme leaves over top. Cook, stirring occasionally, until the vinegar is reduced and syrupy, 1 to 2 minutes. Remove from the heat.
Heat the oven to 400°F. Roll out the pastry dough into an 11-inch round. Lay the pastry round directly over the onions, folding any excess dough up over the top. Bake until the pastry is golden brown, about 25 minutes.
Remove from the oven and let cool in the pan for about 10 minutes. Run a knife around the edge of the skillet, then place a serving plate over the skillet and carefully invert it to unmold the tarte tatin. Don’t fret if you lose any pearl onions in the transfer, simply pop them back into place. Cut into wedges and serve warm.
*Tip: If you just want some delicious glazed onions, omit the crust and simply cook the onions until they are fully tender before adding the vinegar, which should take about 10 minutes longer than noted above.*