Spread the diced eggplant on paper towels and sprinkle liberally with kosher salt. Let it sit for at least 10 minutes, then rinse thoroughly and drain well.
Pour a splash of olive oil to two frying pans and set over medium heat for 2 minutes.
Add the onions to one of the pans along with a pinch of salt. Sauté over medium-low heat until they are transparent, then cover and allow them to steam without browning. Be sure to stir occasionally. Once they're cooked, reserve them in a large bowl.
Meanwhile, add the peppers to the other pan and sauté over medium high heat until browned. Lower the heat to medium, then cover and cook for about 10 minutes, stirring occasionally. Reserve along with the onions.
Cook the zucchini and drained eggplant in the two skillets with a splash of olive oil. Start cooking them on medium high, then turn the heat to medium-low once they begin to brown. Cover and cook until tender, stirring occasionally. Reserve along with the other cooked vegetables.
Add all the spices to the bowl of cooked vegetables and mix well.
Add a bit more oil to one of the pans if necessary, and add the diced garlic (and the dried cayenne peppers if using). Sauté over medium heat until it smells aromatic, about 1 minute.
Add the peeled and diced tomato to the pan. Cook over medium low heat for about 20 minutes, stirring frequently, until you have tomato sauce. Add the sugar and salt to taste.
In a large frying pan, mix the reserved veggie and spice mixture with the tomato sauce and cook over medium heat until hot, about 10 minutes. Taste and adjust seasonings as desired.
Serve the pisto as an appetizer or side dish with meat or fish. If you'd like to serve it as a main course, top it with a fried egg (pisto con huevo) or with thinly sliced Manchego cheese (pisto manchego). Enjoy!