Heat 2 tablespoons of the oil in a large pan, add the onion and cook over a medium heat for 10 minutes, until soft. Add the tomato paste and cook for 1 minute, then add the vinegar, sugar, tomatoes, olives and capers. Cook over a medium heat for a further 20 minutes.
In a medium frying pan, fry the eggplant in two batches using 4 tablespoons of oil for each batch, tossing and turning them for about 10 minutes until they are soft and lightly coloured. Add the first batch to the tomato mixture before cooking the second.
Finally, mix everything together well, season to taste with salt and pepper, then allow the caponata to cool in a bowl. Check the seasoning again when it is cold, since the flavours mellow.
Serve with bread sticks or toasted bread as part of an antipasto.