Pour a little oil into a frying pan, and add the chopped garlic and onions.
Fry for a few minutes before adding the passata and the tomato paste, diluted in a little water. Season with salt and pepper to taste, and simmer until the sauce thickens.
Remove from the heat and add the torn basil leaves. Cut the mozzarella and scamorza cheeses into thin slices, and leave the mozzarella to drain. Cut the eggplants into 1-cm slices.
Pour the peanut oil into a pan and fry the eggplants a few slices at a time so as to maintain the temperature of the oil constant (it should be 170°C); turn them to cook on both sides, then drain on a sheet of kitchen paper.
Pour a spoonful of sauce into the bottom of a 15x20 cm ovenproof dish and start to add the layers. Begin with the slices of eggplant, a little salt and some grated parmesan, then a mixed layer of sliced scamorza and mozzarella.
Repeat the process with a layer of eggplant, etc., continuing until you have used up all the ingredients, and finishing with the eggplant.
Cover with the remaining sauce and grated parmesan, and bake in the oven at 200°C for 40 minutes.
Once cooked, turn off the oven and leave the parmigiana inside. Serve lukewarm or cold.