Preheat the oven to 350ºF. Roughly chop the mushrooms into small pieces. Mince the garlic.
Add the olive oil to a large skillet and heat over medium. Once hot, add the mushrooms and a pinch of salt and pepper. Sauté the mushrooms until soft, then add the minced garlic and continue to sauté until the liquid in the skillet evaporates.
Add the butter and flour to the skillet. Stir to melt the butter and allow the butter and flour to create a paste that coats the bottom of the skillet. Continue to stir and cook over medium for one to two minutes, or until the flour begins to turn golden on the bottom of the skillet.
Add the vegetable broth, milk, and garlic powder to the skillet. Whisk to combine and dissolve any browned flour off of the bottom of the skillet. Allow the liquid to come up to a simmer, at which point it will thicken.
Add the cream cheese to the skillet and whisk over medium heat until the cream cheese has fully melted into the sauce.
Add the frozen green beans to the sauce and stir to combine. Continue to heat over medium, stirring occasionally, until the green beans have heated through and the sauce comes up to a gentle simmer. Let the green beans simmer for a few minutes. Give them a taste and add salt and pepper to your liking (I added about ½ tsp salt and another ⅛ tsp pepper).
Stir ¼ cup of crispy fried onions into the green bean mixture. Pour the green beans into a 2-quart casserole dish and top with the remaining ¾ cup crispy fried onions.
Bake the casserole for 20-25 minutes, or until the fried onions have turned deep golden brown and the sauce is bubbling up around the edges.
*I use fresh mushrooms to infuse the creamy, gravy-like sauce with flavor. Baby Bellas are my favorite mushrooms to use in this recipe, but button mushrooms are just as good.**I almost always use Better Than Bouillon to make broth because it's already well flavored and salted. Mixing it with milk also adds just the right amount of creaminess to the casserole.***For a really stellar green bean casserole, I suggest using either fresh or frozen green beans. Canned green beans tend to be too mushy, and their flavors are a bit muddy.