Cut the eggplants into 3/4-inch cubes. Transfer them to a colander, salt generously, weigh them down with a plate, and let them drain for 30 minutes in the kitchen sink.
Cut the half onion into very thin slices. Cut the whole onion into chunks roughly the same size as the eggplant cubes. Cut the celery into chunks and cut the cherry tomatoes in half.
Pour the olive oil into a large nonstick skillet set over medium heat, add the sliced onion and garlic, and cook for about 3 minutes, until the garlic is slightly browned. Add the celery, tomatoes (both cherry and chopped), olives, capers, and the chopped onion to the skillet and cook for 10 minutes, until the vegetables begin to soften. Add the vinegar and sugar and cook for another 10 minutes. Remove from the heat.
Remove the plate covering the eggplant and squeeze the eggplant in the colander to remove any remaining liquid.
Pour 1 inch of sunflower or peanut oil into a large saucepan and warm over medium heat until a deep-fry thermometer reads 350 F. You can test the oil by dropping a small piece of food, such as a slice of apple, into it: If it sizzles nicely but doesn’t bubble up too wildly, the oil is ready.
Add only as many eggplant cubes to the pan as will fit in a single layer without crowding and fry until golden, turning often. Remove the eggplant with a slotted spoon and spread it out on a paper towel-lined plate to drain. Cook the remaining eggplant cubes in the same manner, adding more oil if needed.
Once the fried eggplant has drained, add it to the skillet of vegetables. Season with 1/2 teaspoon salt and pepper to taste, adding a bit of water if the vegetables look dry, and cook the caponata over medium heat, stirring frequently, for 5 minutes.
Stir in the basil leaves, remove from the heat, and let the caponata cool to room temperature before serving.