3 cups onions (2 large), halved lengthwise and sliced thin crosswise
2 tablespoons olive oil
1 teaspoon minced fresh thyme leaves or 1/4 teaspoon dried, crumbled
2 1/2 pounds large red potatoes (about 7)
4 ounces chilled soft mild goat cheese from a log or disk, crumbled
1 1/2 tablespoons cold unsalted butter, cut into pieces
1 cup milk
In a heavy 5- to 6-quart kettle heat oil over moderate heat until hot but not smoking and cook onions with thyme and salt and pepper to taste, stirring occasionally, until golden, about 15 minutes. Reduce heat to moderately low and cook, stirring frequently to keep from scorching, until golden brown. Remove kettle from heat.
While onions are cooking, bring a large saucepan of salted water to a boil for potatoes. Peel potatoes and cut crosswise into 1/4-inch-thick slices. Add potatoes to boiling water and cook 5 minutes from time water returns to a boil. Drain potatoes well in a colander.
Preheat oven to 425°F. and lightly oil a 2- to 2 1/2-quart gratin dish or other shallow baking dish.
Arrange half of potatoes, overlapping slightly, in dish and season generously with salt and pepper. Cover potatoes with onions, spreading evenly, and top with goat cheese. Arrange remaining potatoes, overlapping slightly, over cheese and season generously with salt and pepper. Dot gratin with butter. Gratin may be prepared up to this point 2 hours ahead and kept at room temperature, covered.
Pour milk evenly over potatoes and bake 35 minutes, or until potatoes are tender and top is golden. Gratin may be made 1 day ahead and chilled, covered. Reheat gratin before serving.