Wrapping the sweet potatoes in foil ensures that they don't dry out too quickly, and allows you to add aromatics if desired. Unwrapping the sweet potatoes and increasing the oven temperature produces charred, roasted flavors and caramelizes converted sugars.