See, we get nutrients- vitamins and all- from the food we eat. A portion of this goes into building our immune system. New white blood cells and platelets are created by these nutrients that are absorbed. When we do not eat, the body invests all its nutrients on making energy for the body to perform daily tasks. This means, there is a cutoff from the usual nutrient payment to the immune-system, finally creating a condition commonly called immunodeficiency.
Hope this helps!