2 Tbs. unsalted butter; more for the pan
2 Tbs. olive oil
6 oz. pancetta or country ham, cut into 1/4-inch dice
1/4 cup minced garlic
2 cups heavy cream
3 Tbs. fresh thyme leaves
1 tsp. coarse salt
Freshly ground black pepper to taste
2 medium sweet potatoes (1 lb. total), peeled
3 medium Idaho potatoes (1-1/4 lb. total), peeled
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.