An underlying medical condition or certain treatments may be the cause.Normally, your immune system works to repel harmful invading organisms, such as viruses, bacteria and fungi, while maintaining a balance between good and bad microbes that normally inhabit your body.