Dice the onions, either medium dice or small dice, according to the desired chunkiness of the onion spread.
Heat the oil in a large, deep pan over medium heat. Add the chopped onions and sauté, stirring regularly, until translucent.
Add all the remaining ingredients except the pepper. Bring the mixture to a boil, stirring regularly.
Turn the heat down low and allow the liquid to reduce to a thick, jammy texture, about 1 hour, stirring every 5–10 minutes.
Remove the onion jam from the heat. Season with pepper. Taste and adjust salt as needed.
Let the jam cool completely before storing in an airtight container in the fridge for up to 1 month.