Preheat oven to 425 degrees. Grease a 13 x 9-inch casserole dish.
Cook bacon in a medium saucepan over medium-low heat until crisp, about 10-13 minutes. Using a slotted spoon remove the bacon from the pan and onto paper towel. Reserve the bacon drippings in the skillet.
Turn the temperature up to medium heat. Add the onions to the bacon drippings along with ¼ teaspoon of salt. Cook, stirring frequently until onions start to become soft and caramelized, about 15 minutes. Transfer onions to a large bowl. Return the saucepan to the hot burner.
Pour the broth into the saucepan. Using a wooden spoon, scrape up any bits that have formed on the bottom of the pan. Add thyme, remaining salt and pepper to the broth. Bring broth to a simmer.
Add the bacon and potatoes to the mixing bowl with the onions. Stir until mixture is well-combined.
Spread the potatoes into the casserole dish.
Carefully pour the hot broth over top.
Dot the surface of the casserole with butter.
Bake uncovered for 45-55 minutes until the potatoes are fork tender and the edges are golden brown.
Sprinkle the cheese over the top of the casserole. Return to the oven and bake until the cheese is melted, about five minutes.
Remove from oven and allow potatoes to sit for 15 minutes before serving.