Immunocompetence refers to the degree to which the immune system functions effectively.