Thinly slice the onions by first cutting in half, then removing the core at an angle. Thinly slice the onions like a fan. Over medium heat, add the oil followed by the onions. The onions will start to sweat and cook down, releasing their liquid. Continue to cook over low heat, stirring every 2-3 minutes until the moisture is gone, 20 minutes or more as needed, depending on moisture level of the onions.
When all of the moisture’s been cooked out of the onions, turn the heat back to medium, add the sugar, a pinch of salt, and the vinegar and bring to a boil to dissolve the sugar and combine. Turn the heat to low and reduce until the mixture is a thick jam, about 45 minutes.