Heat olive oil in a saucepan over medium heat; stir onion in the hot oil. Reduce heat to medium-low, cover saucepan, and cook, stirring occasionally, until onion is softened and caramel-colored, 20 to 25 minutes.
Stir figs into onion; cook and stir until figs begin to lose their shape and have softened into onion, 10 to 15 minutes.
Pour balsamic vinegar into fig-onion mixture; cook until all the liquid has evaporated, 5 to 10 minutes. Stir sugar, 1 tablespoon at a time, into fig-onion mixture until desired sweetness is reached.