He says he is too mentally and physically frail, basically.
'Dear Brothers,
I have convoked you to this Consistory, not only for the three canonisations, but also to communicate to you a decision of great importance for the life of the Church. After having repeatedly examined my conscience before God, I have come to the certainty that my strengths, due to an advanced age, are no longer suited to an adequate exercise of the Petrine ministry.
I am well aware that this ministry, due to its essential spiritual nature, must be carried out not only with words and deeds, but no less with prayer and suffering. However, in today?s world, subject to so many rapid changes and shaken by questions of deep relevance for the life of faith, in order to govern the bark of Saint Peter and proclaim the Gospel, both strength of mind and body are necessary, strength which in the last few months, has deteriorated in me to the extent that I have had to recognise my incapacity to adequately fulfil the ministry entrusted to me.'
...more if you read the full text. www.guardian.co.uk/world/2013/feb/11/pope-resigns-live-reaction
Dementia or similar would certainly preclude exercise of public duties in a way that other diseases wouldn't.