Preheat the oven to 350°F (175°C). Lightly grease a 9 x 13-inch baking dish with cooking spray or butter. Make sure the hash browns are completely thawed and drain away any excess moisture before using them.
In a large mixing bowl, whisk together the condensed cream of chicken soup, sour cream, and ½ cup melted butter until smooth. Add the garlic powder, onion powder, salt, and black pepper. Stir until the seasonings are evenly incorporated.
Fold 2 cups of shredded cheddar cheese and the finely chopped onion into the creamy mixture. Stir gently so the cheese and onion are distributed throughout the sauce.
Add the thawed hash browns to the bowl. Use a large spoon or rubber spatula to fold them into the sauce until all the potatoes are evenly coated. Avoid breaking up the potato shreds too much.
Spread the potato mixture into the prepared baking dish. Smooth the surface with a spatula so the casserole cooks evenly from edge to edge.
In a separate bowl, combine the crushed cornflakes with 3 tablespoons of melted butter. Stir until the flakes are lightly coated. Sprinkle the mixture evenly over the potato layer, then add the remaining ¼ cup of shredded cheddar cheese.
Place the casserole in the preheated oven and bake uncovered for 45–50 minutes, or until the edges are bubbling and the topping is golden brown. If the cornflakes begin to brown too quickly, loosely cover the dish with foil during the final part of baking.
Remove the casserole from the oven and let it rest for 5–10 minutes before serving. This gives the creamy filling time to settle and makes it easier to scoop into portions. Serve warm while the cheese is melted.