For the bacon-onion jam: Heat the oil in a cast-iron pan on medium heat; add the onion and cook until beginning to brown, 5 to 7 minutes. Add the bacon and thyme and reduce the heat to low. Cook for 10 to 12 minutes, then transfer the bacon and onion from the pan with a slotted spoon into a small saucepot. Reserve the bacon fat in the pan for cooking the tenderloin.
Put the saucepot with the bacon-onion mixture over medium-low heat and add the brown sugar and coffee. Cook the mixture down to a thick consistency, 25 to 30 minutes. Stir in the apple cider vinegar.
For the pork tenderloin: Preheat the oven to 425 degrees F. Pat the tenderloin dry with paper towels, sprinkle with the garlic powder and season well with salt and pepper.
Heat the reserved bacon grease in a cast-iron pan over medium-high heat and place the tenderloin in the hot fat. (This comes out even better if you use the same pan you made the jam in; you get all the flavor from the jam.) Sear on all sides, then transfer the pan to the oven to finish cooking to an internal temperature of 135 degrees F, 12 to 15 minutes. Let rest for 5 to 10 minutes before slicing. Serve with the bacon-onion jam.