Preheat the oven to 400°F (200°C) and generously butter a 9x13-inch baking dish.
In a medium saucepan, melt the butter over medium heat. Add the flour and whisk for about 1 minute to form a smooth paste. Gradually pour in the milk, whisking constantly to avoid lumps, then slowly add the vegetable broth. Continue whisking until the mixture begins to thicken. Add the garlic, thyme, salt, and black pepper, and cook for another 2 to 3 minutes, or until the sauce lightly coats the back of a spoon. Remove from the heat and set aside.
Arrange half of the potato slices evenly across the base of the prepared dish. Layer half of the sliced onion on top, then pour half of the creamy sauce over the potatoes, ensuring even coverage. Sprinkle with 1 cup of grated cheddar cheese. Repeat with the remaining potatoes, onion, sauce, and top with the remaining ½ cup of cheese.
Cover the dish tightly with foil and bake for 30 minutes. Then, uncover and continue baking for 35 to 40 minutes more, or until the potatoes are tender and the top is bubbling and golden brown.
Remove from the oven and allow the dish to rest for about 20 minutes before serving. This will help the layers set beautifully, making it easier to slice and serve. Each portion should reveal soft, creamy potatoes nestled under a blanket of melted, flavorful cheese and aromatic herbs.