This a great question that's not that easy to answer. Scholars have hotly debated this topic for many years, and it's probably instructive to examine some older perspectives before laying out modern views.
Edward Gibbon was one of the first modern historians to broach the topic in The History of the Decline and Fall of the Roman Empire, explaining that
Diocletian acquired the glory of giving to the world the first example of a resignation which has not been very frequently imitated by succeeding monarchs.
Importantly, he notes as well that
the active life of [Charles and Diocletian], their wars and journeys, the cares of royalty, and their application to business, had already impaired their constitution,and brought on the infirmities of a premature old age
So, in his reading, a combination of moral righteousness and the labours of age led Diocletian to lay down the paludamentum^1 . However, Gibbon, whilst often praised for his presentation, has subsequently been criticized for straying a bit too far from the sources.
Therein lies the challenge of this question: the main surviving contemporary account of Diocletian's reign and the tetrarchy^2 is Lactantius' De mortibus persecutorum, a Christian apologetic work that outlines how the Diocletianic persecutions attracted the wrath of God. Lactantius was aware of the historical import his work might one day hold, aiming to prevent that "any future historian of the persecutors should corrupt the truth". Unfortunately, that does little for whatever corruption and bias he himself baked into his polemic account.
Lactantius recounts in fairly precise detail the events leading up to to Diocletian's abdication at Nicomedia^3 , from the illness that fell upon him leaving Rome to the pressure that Galerius, the junior Caesar that had been designated alongside Constantius, exerted upon him. Lactantius relates that Diocletian eventually relents under the threats of Galerius, muttering tearfully "Fiat inquit si hoc placet", "Be it as you will". He then describes the abdication itself:
An assembly of the soldiers was called. Diocletian, with tears, harangued them, and said that he had become infirm, that he needed repose after his fatigues, and that he would resign the empire into hands more vigorous and able, and at the same time appoint new Caesars. The spectators, with the utmost earnestness, waited for the nomination. Suddenly he declared that the Caesars were Severus and Maximin. The amazement was universal. Constantine stood near in public view, and men began to question amongst themselves whether his name too had not been changed into Maximin; when, in the sight of all, Galerius, stretching back his hand, put Constantine aside, and drew Daia forward, and, having divested him of the garb of a private person, set him in the most conspicuous place.
It is important to situate this account within contemporary Roman perspectives: it was unthinkable, at the time, that an emperor would voluntary leave the seat of power. Thus, ancient accounts will find various alternative explanations, poor health or fatigue and old age, political pressure, or even divinely inflicted madness as retribution for the persecutions of Christians.
However, modern scholarship situates the intention to abdicate earlier, and emphasizes Diocletian's own motives. Even before the long journey during which he was besieged by illness, during the celebration of Vicennalia^4 , Diocletian announced to Maximian his intention to retire, which the latter accepted, however reluctantly. Also of note, the records of the reigns were adjusted so that Maximian, who had only been Augustus for 19 years, could celebrate the Vicennalia alongside Diocletian. This has thus shifted the view towards Diocletian very emphatically setting the stage for his coming retirement, leveling himself with Maximian in order not to be seen as the true senior emperor. If this were the case, his illness and long journey would have actually delayed his abdication, not precipitated it.
The story does not end here however. Nappo recently argued an even more startling hypothesis, backed by a fairly meticulous examination of sources and archeological^5 evidence: that Diocletian never really abdicated at all, at least not in the way the scholarship has traditonally interpreted it.
He posits that the collegium was no true Tetrachy, but Diocletian was rather trying to transition to a "hexarchy", wherein there would be two Caesares, two Augusti and two seniores Augusti. He also underlines that both Maximian and Diocletian would hold active roles in the political upheavals after Diocletian's abdication. In essence, the intention would have been to relinquish the imperium, the military command of the empire, but remain a member of the collegium to smooth the transition of power. In this light, Diocletian was not an tired old man seeking to tend his cabbages, as the likely pagan Epitome de Caesaribus would have you believe, but an astute politician taking a risky gamble on a new organization for imperial power.
^1 ^: ^Imperial ^military ^cloak
^2 ^: ^Worth ^noting ^that ^the ^notion ^of ^tetrarchy ^to ^describe ^the ^collegium ^of ^emperors ^is ^completely ^anachronistic, ^originating ^in ^the ^19th ^century
^3 ^: ^Ancient ^city ^located ^today ^in ^modern ^Turkey
^4 ^: ^Celebration ^of ^20 ^years ^of ^Imperial ^reign
^5 ^: ^Specifically, ^epigraphical ^and ^numismatic
References
C. S. Mackay, Lactantius and the Succession to Diocletian, Classical Philology 94
J. Rougé, L’abdication de Dioclétien et la proclamation des Césars: degré defiabilité du récit de Lactance, Institutions, société et vie politique dans l’empire romain au IVe siècle ap. J.-C. (in French)
E. Gibbon, The History of the Decline and Fall of the Roman Empire, London
D. Nappo, On Diocletian’s So-Called Abdication, Koinonia 42