It will create a sort of steam bath for your potatoes, preventing them from drying out or burning up before they're cooked through. Just make sure you tightly close the foil.
Poke holes in the potatoes' skin before baking, or they may burst or end up undercooked in the middle. They're done once tender enough to be pierced with a toothpick.