Stir in the remaining 1 cup of milk and the onions.
Layer half of the potato slices in the bottom of the prepared baking dish. Season them generously with salt and pepper.
Pour half of the cheese sauce mixture over the potatoes to coat evenly. Add the remaining potatoes to form a second layer, season with salt and pepper, and top with the remaining half of the cheese sauce.
Cover and bake for 1 hour. Uncover and continue baking until the potatoes are tender when pierced with a fork and the top is browned, 25 to 30 minutes more.
Cool 5 minutes before serving.
OPTIONAL: Sprinkle fresh thyme on top for an additional touch of flavor.