Lift the leeks gently from their soaking water so that any grit stays behind. Drain them in a colander. In a medium saucepan over medium heat, melt the butter in the olive oil. Add the pancetta or ham and cook, stirring occasionally, until golden, about 9 min. Remove with a slotted spoon to drain on paper towels. Add the leeks and garlic to the pan, cover, and reduce the heat to low. Sweat the leeks and garlic, cooking slowly and stirring occasionally, until the leeks are softened, about 5 min. (Don't let the leeks or garlic brown.) Add the cream, bring to a boil, reduce the heat, and simmer uncovered for 5 min. Stir in the pancetta or ham, the thyme, and the salt; add pepper to taste. Set aside.
Heat the oven to 350°F. Butter a 2-qt. casserole dish. Slice the sweet potatoes between 1/4 and 1/8 inch thick. Repeat with the Idaho potatoes. Arrange one overlapping layer of Idaho slices on the bottom of the casserole. Season lightly with salt and pepper; spoon 2 Tbs. of the leek cream evenly over the potatoes. Add a layer of sweet potato slices, season lightly with salt and pepper, and spoon on another 2 Tbs. of the leek cream. Repeat with the remaining potatoes until all are used. With your hands or a rubber spatula, press down firmly on the potatoes and drizzle the remaining leek cream over them. Bake until the gratin is golden on top, 50 to 60 min. Let rest in a warm place for 15 min. Cut into squares and serve.
For this gratin, arrange the slices so they overlap slightly.
Before you drizzle on the last of the leek cream, press down to compact the layers of potatoes.