Chronic illness that involves overactivation of the immune system (for example, chronic infections, or an autoimmune disease where the immune system has accidentally activated and is attacking some part of your body) is more likely to cause depression than other equally severe and prolonged illnesses that don’t involve the immune system.