Preheat the oven. Set it to 400°F (200°C). A hot oven helps the cheese melt evenly and the tomatoes release their juices without turning mushy.
Prep the tomatoes. Slice medium tomatoes about 1/4-inch thick, or halve cherry tomatoes. If your tomatoes are especially juicy, pat them dry with a paper towel to avoid excess liquid.
Season the base. In a shallow baking dish or ovenproof skillet, drizzle 1 tablespoon of olive oil.
Scatter the tomatoes in an even layer. Sprinkle with salt, pepper, and half the garlic. Add a light pinch of red pepper flakes if you want heat.
Add the mozzarella. Arrange slices or chunks of mozzarella over the tomatoes, tucking them in so every bite has both tomato and cheese.
Don’t pack it too tightly; leave small gaps for steam to escape.
Layer in the herbs. Add most of the basil (tear it just before adding) and any oregano or thyme if using. Drizzle the remaining olive oil over the top and add the rest of the garlic.
Bake until bubbly. Place the dish on the middle rack and bake for 12–15 minutes, until the cheese is melted and starting to brown in spots. If you like extra color, switch to broil for 1–2 minutes at the end, watching closely.
Finish and rest. Remove from the oven and let it sit for 5 minutes.
Drizzle with balsamic glaze or a few drops of vinegar, and scatter the remaining fresh basil on top for a bright finish.
Serve warm. Spoon into bowls or serve straight from the skillet with toasted bread for scooping. It’s also great over cooked pasta or alongside grilled chicken.