Covering a casserole with foil serves two purposes. One, it helps keep heat inside the casserole dish so the casserole cooks evenly. And two, it helps retain moisture and steam, keeping the casserole moist.