Slice the heads of garlic in half crosswise and drizzle with the oil. Wrap the garlic in foil and roast until creamy, about 1 hour. When cool enough to handle, squeeze the cloves into a small bowl and mash lightly with a fork.
For the caramelized onions:
Heat the oil in a large skillet set over medium heat. Add the onions and cook, stirring occasionally and lowering the heat if the onions begin to burn, until golden, about 30 minutes.
For the mashed potatoes:
Put the potatoes in a medium pot, cover with cold water and add 2 tablespoons salt. Bring just to a simmer and simmer the potatoes, uncovered, until tender, about 45 minutes. Drain.
Peel the potatoes and return them to the pot (if desired, pass them through a ricer or food mill after peeling). Add the onions. Mash the potatoes and onions with the milk and butter using a fork or potato masher. Stir in the roasted garlic and 2 teaspoons salt; season with pepper.
Copyright 2016 Television Food Network, G.P. All rights reserved.