Cooking the ham covered in tin foil for the first 40 minutes of the cooking process is crucial to keeping the ham moist as it will help to lock in the juice while not over cooking the ham.