Preheat oven to 425 degrees. Grease a 13 x 9-inch casserole dish.
Cook the bacon in a medium skillet over medium 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.
Add the onions to the bacon drippings along with ¼ teaspoon of salt. Cook, stirring frequently until the onions start to become soft and caramelized, about 20-30 minutes. Transfer the onions to a large bowl. Return the skillet to the hot burner.
Pour the broth into the skillet. Using a wooden spoon, scrape up any bits that have formed on the bottom of the pan. Add the thyme, remaining salt, and pepper to the broth. Bring the broth to a simmer.
Add the bacon and potatoes to the mixing bowl with the onions. Stir until the mixture is well-combined.
Spread the potatoes into the casserole dish.
Carefully pour the hot broth over the 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 it to the oven and bake until the cheese is melted, about five minutes.
Remove the potatoes from the oven and allow them to sit for 15 minutes before serving.