Place an oven rack on the upper third shelf and preheat the oven to 400 degrees F.
Pat the pork tenderloin dry using paper towels, then use a knife to remove the silver skin. Season all over with salt and pepper.
Heat the oil in a large, oven-safe skillet over medium-high heat. Add the tenderloin and sear, turning occasionally with kitchen tongs, until brown on all sides, 8-10 minutes. If the pan starts smoking too much, reduce the heat to medium. Transfer to a plate and set aside.
Turn the heat to medium and add the apples, onions, and a pinch of salt. Cook, stirring frequently, until the ingredients start to brown, 3-5 minutes. You want the apples to still be slightly firm. If the brown bits in the pan look like they might burn at any point, add 1 tablespoon of water and use a spatula to scrape them up and stir into the other ingredients. This step can be repeated as needed.
Once the ingredients have lightly caramelized, stir in 1 teaspoon of thyme and remove the pan from the heat. Brush the seared tenderloin with the remaining Dijon mustard, sprinkle with the remaining thyme leaves, and nestle it among the apples and onions in the pan.
Transfer the pan to the oven and roast until the internal temperature of the pork reaches 140-145 degrees F, 15-30 minutes (see notes). Remove from the oven and transfer the pork to a cutting board to rest for 10-15 minutes. Tent the pork with foil to keep it warm.
Return the pan to the stove and turn the heat to medium-low. Add the chicken stock, lemon juice, brown sugar, and remaining teaspoon of Dijon. Stir, scraping up any brown bits from the bottom, until the liquid has reduced to a glaze, 3-5 minutes. Turn off the heat and stir in the butter. Taste the glaze and add additional salt and pepper if needed.
Slice the pork tenderloin and serve alongside the apples and onions, drizzling the glaze on top.