Chop the onion and eggplant into small cubes then add them to a large pan with a drizzle of olive oil. Fry until the eggplant absorb all the oil, then season lightly with salt and black pepper.
Add the tomatoes, fill half of the can with water and add it to the pan as well. Mix well with a spoon and break the tomatoes every now and then until they become a smooth sauce.
Turn the heat to low and let it cook at least 15 minutes. If necessary add a pinch of sugar to balance the tomato acidity and season again with salt and black pepper to taste.
In the meanwhile bring a large pot of water to boil and add a punch of salt when it starts to bubble. Toss the pasta in when the sauce is halfway through the cooking.
When the pasta is almost ready (al dente) drain it and add it to the pan with the sauce. Mix well together so the pasta will start to absorb the flavors and add the mozzarella chopped into cubes.
Stir thoroughly for a couple of minutes, until the mozzarella is completely melted and blended in the sauce.
If you wish to enrich with more flavors this recipe (although believe me it's not necessary) you can add some basil leaves in the sauce and some grated Parmesan (or better Pecorino cheese) before serving.