Preheat your oven to 375°F and bring a large pot of salted water to a rolling boil. Cook ziti according to package directions until al dente—approximately 9 minutes. Drain pasta thoroughly without rinsing, reserving ½ cup pasta water for later adjustments.
While pasta cooks, heat olive oil in a large skillet over medium-high heat. Add diced onion and sauté until softened and translucent, about 3 minutes. Stir in minced garlic and cook 1 minute longer until fragrant.
Add ground beef to the skillet, breaking it apart with a wooden spoon as it browns. Cook 5–7 minutes until no pink remains, then drain excess grease. Pour marinara sauce into the meat mixture and stir well to combine.
In a medium bowl, whisk together ricotta cheese, egg, Italian seasoning, salt, black pepper, and red pepper flakes. Fold in 1½ cups mozzarella cheese and ¼ cup parmesan cheese until the ricotta mixture combines smoothly. This creamy baked ziti crowd component creates the signature rich texture everyone craves.
Combine cooked pasta with the meat sauce in a large mixing bowl, stirring gently to coat all noodles evenly. Add reserved pasta water if the mixture seems dry. Transfer half the pasta mixture to a greased 9x13-inch baking dish.
Spread half the ricotta mixture over the pasta layer, then top with remaining pasta. Dollop remaining ricotta mixture across the top, smoothing gently with a spatula. Sprinkle remaining mozzarella and parmesan cheese over everything.
Cover the baking dish with aluminum foil and bake 15 minutes. Remove foil and continue baking 12–15 minutes until cheese bubbles vigorously at the edges and the top browns lightly. Cool 5 minutes before serving for easier portioning.