Prep the eggplant. Slice the eggplants into 1/2-inch rounds.
Lay them on a sheet pan and sprinkle both sides with salt. Let them sit for 20–30 minutes to draw out moisture. Pat dry thoroughly with paper towels.
Heat the oven. Preheat your oven to 400°F (200°C).
Lightly grease a 9x13-inch baking dish or similar casserole.
Make the garlic oil. In a small bowl, combine the olive oil, minced garlic, oregano, thyme, red pepper flakes, and a few grinds of black pepper. Stir well. If using balsamic, whisk it in now for a subtle tang.
Par-cook the eggplant (optional but helpful). For a softer texture and less oil absorption, brush eggplant rounds with a little garlic oil and roast on a sheet pan for 12–15 minutes, flipping once.
This step deepens flavor and reduces bake time.
Layer the bake. Arrange a layer of eggplant in the dish, slightly overlapping. Top with a scattering of onions, then a layer of tomato slices. Spoon some garlic oil over the tomatoes and season lightly with salt and pepper.
Repeat the layers until all vegetables are used.
Add the topping. In a small bowl, mix breadcrumbs and Parmesan. Sprinkle evenly over the top. If using mozzarella, tuck it between layers or add a light layer on top, under the breadcrumb mix.
Bake. Cover loosely with foil and bake for 20 minutes.
Remove foil and bake another 15–20 minutes, until the top is golden and the vegetables are tender and bubbling at the edges.
Finish and rest. Let the bake rest for 10 minutes. Sprinkle with chopped basil or parsley before serving.
Serve. Enjoy warm as a side with roasted chicken or fish, or as a main with crusty bread, quinoa, or a green salad.