As one ages you get an involution of the thymus affecting maturation of T cells and you get quantitiative and qualitative decreases in cellular immunity. Genetics plays a role. There are obvious genetic disorders, many of which result in immune deficiency disorders because of the inability of the body to produce one or more immune elements. For example, Bruton's Hypogammagloulinemia is an X linked genetic disorder resulting in a deficiency of B cells. Gender plays a role.
Temperature is a factor.
Lymphocytes perform best at 40 degrees centigrade. Sleep wake cycles play a role. Sleep deprivation decreases the ability of neutrophils to phagocytize. Cortisol, produced in greatest amounts at 5AM suppresses immune functioning. Nutrition plays a role, both malnutrition and obesity increases the incidence of infectious diseases.