Preheat your oven to 375°F. Cook ziti pasta according to package directions until just al dente (about 8-10 minutes)—it will continue cooking in the oven, so avoid overcooking. Drain the pasta and set aside without rinsing to retain starch for better sauce adherence.
Heat olive oil in a large skillet over medium-high heat. Add diced onion and cook until softened, about 3 minutes, then add minced garlic and cook 1 more minute until fragrant. This aromatic base creates the foundation for your baked ziti pasta flavor profile.
Add ground beef to the skillet and cook until browned, breaking it into small pieces (5-7 minutes). Drain excess fat if needed, then stir in marinara sauce, Italian seasoning, salt, black pepper, and red pepper flakes. Simmer for 3-4 minutes to let flavors meld together beautifully.
In a separate bowl, combine ricotta cheese, 1½ cups mozzarella, parmesan, egg, and a pinch of salt. Mix until smooth and well-combined. This creamy mixture creates pockets of richness throughout your casserole.
In a 9x13-inch baking dish, spread a thin layer of meat sauce on the bottom. Add half the cooked pasta, then half the ricotta mixture, then half the remaining meat sauce. Repeat layers, finishing with meat sauce, and top with remaining ½ cup mozzarella cheese.
Cover with aluminum foil and bake for 25 minutes, then remove foil and bake until cheese is bubbly and golden (15 more minutes). Let it rest 5 minutes before serving to allow the casserole to set slightly.