Melt the butter in a pot over medium-high heat.
Add the onions and cook, stirring frequently, until they are nearly soft, about 4 to 5 minutes.
Next, add the garlic and flour, cooking for about 1 minute while stirring constantly. While whisking, gradually pour in the milk, followed by the chicken broth. Then, stir in the broccoli.
Cook the mixture, stirring constantly, until it starts to thicken. Then, reduce the heat to low and let it cook, stirring very frequently, until the broccoli is tender, about 6 to 8 minutes.
Remove from heat and stir in the heavy cream, followed by the cheddar and Parmesan cheese, mixing until melted.
Season with salt and pepper to taste.
Serve warm, adding more cheddar on top if desired.