Pre-heat oven to 350F degrees.
In a medium sauce pan add figs, sherry and just enough water to cover the figs. Heat mixture to boiling and remove from heat. Set aside.
In an oven-proof skillet (cast iron is excellent), heat 2 tablespoons of the oil over medium-high heat. Add pork and cook on all sides until outside of meat is seared, adding more oil if necessary.
Pour figs and the juices they cooked in over the pork.
Add remaining oil to the pan, less or more to your liking.
Place 2 of the rosemary sprigs over the pork and place in pre-heated oven. Cook for 25 minutes then check the internal temperature of the pork. If temp is at or near 165F degrees, remove pork from the pan onto a plate, tent loosely** with aluminum foil.
Slice the red onion pole to pole and stir the onion and garlic into the fig mixture and meat drippings. Add the 3rd rosemary sprig to the pan at this time. Place the pan back in the oven (if the meat is not done, center it over everything to cook further). Cook an additional 15 minutes or until red onions have caramelized to your liking, stirring occasionally.
Note: if you removed the meat at the 25 minute mark, place it back in the oven on top of the other ingredients during the last 5 minutes to help it remain warm and to get the flavors of the onions, etc.
Remove from oven and slice tenderloin (if it hasn't come out of the oven at all yet, let the meat rest about 10 minutes before slicing).
Serve with the onion and fig mixture poured over meat or on the side.
**It is important to tent the aluminum loosely over the pork during resting. If you enclose the meat too tightly in the aluminum, the pork may continue to cook and over-cook, releasing much of the juices that keep the meat tender.