most fungus infections, like most bacterial ones are with us all the time. We pick them up from the environment or other people and often small amounts live on our skin causing no harm whatever. The mischief happens when the environment they are living in (like your scalp) becomes more hospitable to them and often at the same time less hospitable to other bacteria or fungi, The infection takes advantage of the change in environment to begin growing and multiplying and then you get symptoms. Changes which will help infections to grow tend to be changed PH, increased humidity, increased food source and a lessening in mechanical removal. Its also possible (although I am sure that your doctor has checked) that the onset of diabetes can make fungal infections more likely.