This relish is based on Italian caponata, which is usually served cold or at room temperature as an appetizer or an accompaniment to meat, poultry, and fish.
Heat oil in a large skillet over medium heat. Add onion and garlic; season with salt and pepper. Cook, stirring occasionally, until onion is softened, 6 to 8 minutes.
Add eggplant and tomatoes. Cover; cook, stirring occasionally, until eggplant is very soft, 10 to 15 minutes.
Add vinegar, pine nuts, olives, raisins, sugar, and capers; cook (uncovered) over medium-low heat until vegetables begin to break down, 10 to 12 minutes.
Transfer to a shallow bowl or a rimmed baking sheet; let cool completely. Stir in parsley, and season with salt and pepper. Relish can be refrigerated, covered, up to 5 days.
If vegetables begin to stick to the bottom of the skillet during cooking, add a splash of water, and scrape up the bits with a wooden spoon.