Covering with foil helps keep the moisture in the casserole, and also prevents the cheese on top from cooking too quickly and burning.