Aluminum foil helps lock in moisture so the potatoes don't dry out, and can also help with even cooking. However, it is not necessary to wrap potatoes in foil.