Preheat the oven to 425°F (220°C). Position a rack in the upper third of the oven.
Using a sharp, thin-bladed knife, remove the long thin muscle and connective tissue that runs almost the length of the beef tenderloin. Reserve it for another use, such as stir-frying or ground beef. Then remove and discard the silver skin and most of the surface fat from the tenderloin.
Next, about 5 to 6 inches (13 to 15 cm) from the narrow end of the beef tenderloin, make a shallow cut crosswise across the tenderloin, cutting about halfway through the meat. Fold this narrow end piece under so that the tenderloin is uniformly thick from one end to the other. Secure the tenderloin with kitchen string, tying it at 1 1/2-inch (4-cm) intervals along the length of the tenderloin.
Place the tenderloin on a rimmed baking sheet. Brush or rub the meat on all sides with 2 tablespoons of the olive oil. Season generously with salt and pepper, firmly pressing the seasonings in with your fingertips. (The roast can be refrigerated, uncovered, for up to 24 hours. Let stand at room temperature for about 1 hour before roasting.)
In a large skillet over low heat, warm the remaining 2 tablespoons olive oil. Add the onions, stir to coat with the oil, and season to taste with salt and pepper. Cook for 2 to 3 minutes, then add 1/4 cup water, the thyme, and the balsamic vinegar. Cover and cook over low heat, stirring occasionally, until the onions are very soft but not browned, about 15 minutes.
Uncover and, if any liquid remains in the skillet, increase the heat to medium-high and cook just until the liquid evaporates. Again, do not let the onions color.
Arrange the onions along the center of a shallow roasting pan just large enough to hold the tenderloin. (If you have a rather lengthy roast, you can spread the onions on the diagonal to make space for it in the pan.) Place the tenderloin on the onions. Roast the tenderloin until a thermometer inserted into the thickest part registers 125°F (52°C) for medium-rare, about 45 minutes. The roast will vary somewhat in doneness depending on the thickness of its sections.
Remove the pan from the oven, transfer the meat to a platter, and tent with aluminum foil. Let rest for 10 to 15 minutes before slicing.