Step 1: Prepare the Vegetables
If using fresh green beans, blanch them in boiling salted water for 3-4 minutes until tender-crisp, then drain. If using frozen, thaw and drain well. In a large skillet, melt butter over medium-high heat. Sauté diced onions and sliced mushrooms for 5-7 minutes until softened. Add minced garlic and cook for 1 more minute until fragrant.
Step 2: Create the Sauce Base
In a large mixing bowl, combine cream of mushroom soup, milk, garlic powder, black pepper, salt, and cayenne pepper. Stir until smooth and creamy.
Step 3: Combine Ingredients
Add the prepared green beans and sautéed mushroom mixture to the cream sauce. Fold in the shredded cheddar cheese. Reserve 2/3 of the fried onions and fold in only 1/3 into the casserole. Stir gently until evenly distributed. Adjust seasonings as needed.
Step 4: Transfer to Baking Dish
Butter a 9x13-inch baking dish and pour the green bean casserole mixture into it, spreading evenly. The mixture should be creamy but not soupy.
Step 5: Initial Bake
Bake uncovered at 350°F for 25 minutes. The casserole should be heated through and bubbling around the edges.
Step 6: Add Crispy Topping and Finish
Remove from oven and sprinkle the reserved fried onions evenly over the top. Return to oven and bake for an additional 5-10 minutes until onions are golden brown and crispy.
Step 7: Cool and Serve
Remove from oven and let cool for 5 minutes before serving. This allows the casserole to set slightly. Garnish with fresh herbs if desired. Serve warm and enjoy!