Preheat your oven to 400°F and lightly grease a 9x13 inch baking dish with oil or cooking spray. While the oven heats, finely dice the onion into 1/4-inch pieces and mince the garlic cloves. This prep work ensures everything is ready when you need it, so the cooking process flows smoothly without interruption.
Bring a large pot of salted water to a boil and add the penne, cooking for 9 minutes (we'll finish cooking it in the oven, so keep it slightly under al dente). While the pasta cooks, heat the olive oil in a large skillet over medium-high heat and add the ground beef and diced onion. Cook for about 8-10 minutes, breaking the beef into small pieces as it browns, until the onion is soft and the meat has lost its pink color. I like to use a meat thermometer to ensure even browning—the beef should reach about 160°F internally.
Add the minced garlic to the skillet and cook for about 1 minute until fragrant. Stir in the marinara sauce and red pepper flakes, then drain any excess fat from the pan if needed. Let the sauce simmer gently for 2-3 minutes to meld the flavors, then season with salt and pepper to taste. This short simmer helps the spices infuse into the sauce for better flavor throughout the casserole.
Drain the pasta in a colander (don't rinse it—the starch helps the dish come together). Pour the cooked penne into the greased baking dish, then add the meat sauce from Step 3 and stir gently to combine, ensuring the noodles are evenly coated. The combination of slightly undercooked pasta and the gentle bake in the oven will bring everything to perfect texture.
Spread the sharp cheddar cheese evenly over the top of the casserole. Place the dish in the preheated 400°F oven and bake for 10 minutes until the cheese is melted and bubbly. I prefer sharp cheddar because it has deeper flavor and melts beautifully without becoming oily like milder cheeses can.
Turn the oven to broil and place the casserole 6 inches from the heat for about 2 minutes, watching closely, until the cheese has a light golden-brown color on top. Remove from the oven and let it rest for 2-3 minutes before serving—this allows the cheese to set slightly and makes plating easier.