Set the oven to 425 °F, 220 °C, with a rack positioned in the center. The oven should reach its baking temperature before the filled dish goes in.
Cook the chopped onion with the olive oil in a large skillet over medium heat for about 8 minutes, stirring as needed. Look for tender onion pieces with golden edges rather than dark, crisp patches.
Stir the grated garlic into the onion and give it a few seconds of heat. A fragrant garlic aroma signals that it is ready for the spinach.
Work the chopped spinach into the skillet in batches, letting each addition collapse before adding the next. The leaves should soften and shrink, opening space for the remaining greens.
Scoop the cooked spinach and onion mixture into a large bowl. The greens should be wilted throughout, without a puddle of cooking liquid coming along with them.
Blend the softened cream cheese into the warm vegetables with a sturdy spoon or spatula. Keep mixing until the cream cheese melts into the greens without distinct white lumps.
Fold in the crumbled feta, half of the shredded mozzarella, and the diced roasted red peppers. The peppers and feta should spread evenly through the creamy spinach mixture.
Distribute the black pepper, dried dill, and crushed red pepper flakes through the bowl. The seasonings should appear throughout the mixture rather than collecting in one spot.
Spread the combined dip in an 8-inch round or square baking dish, then scatter the remaining mozzarella over the surface. An even layer helps the center and edges heat together and gives the topping consistent coverage.
Give the dip about 25 minutes on the center oven rack, checking for bubbling before removing it. The edges should bubble visibly and the cheese topping should melt across the surface.
Switch to the broiler for a 2-minute browning finish, watching the dish closely. Golden freckles on the mozzarella are the goal, so stop sooner if the topping starts to scorch.
Place the baking dish on a heatproof surface and let the dip rest for 15–20 minutes. The mixture should become thicker and offer more resistance to a spoon as it settles.