For finding an appropriate answer, we had better refer to Islamic sources. In some of our narrations the wisdom of Occultation are as follows,
- No to pay allegiance to unjust rulers:
Hassan bin Fazzāl narrates from Imam Ridā to have said,
"As if I see my followers in the aftermath of the death of my third descendant [Imam al-Hassan al-‘Askarī) looking for their Imam everywhere and do not find him." I (Hassan bin Fazzāl) asked him, ‘O the son of the Messenger of Allah! What’s the reason of it?’ He said: "Because their Imam will have entered the state of Occultation." I went on asking the reason of Occultation. He said: "This will be, so that when he rises by sword he will have paid no allegiance to anyone.” [1]
If the Imam would sign a non-intervention treaty with the cruel rulers, he would have been bound to the treaty. As a result, he would be not able to fight against tyrannies, because Islam regards a treaty binding on those who have agreed to its terms. Moreover, the oppressors and unjust rulers would never be tied to acting upon the content of such an agreement because of the perceived danger of the Imam to their power. Hence, they would have murdered the Imam as the only solution for their continued domination over humanity.
- To be immune from murder:
In a narration reported by Zurāra from Imam Sādiq, we read,
“Indeed the Qāim (Imam al-Mahdi) will have an Occultation before his rising." I (Zurāra) asked, ‘why is that?’ He said: "He is afraid" and pointed to his stomach meaning that he is afraid to get killed.” [2]
Indeed, the Imam of the Age, like his forefathers, is not afraid of being killed in the path of Allah as all of his forefathers suffered martyrdom for disseminating the true religion and reforming the society. Nevertheless, his being killed is not in the interest of the religion or the society because when the previous Imams were killed, they had an infallible son to succeed them, but the twelfth Imam is the final Imam and there is no other infallible Imam to succeed him. So, if the twelfth Imam is killed the earth would remain without Allah’s Proof to guide people and supervise their affairs.
Of course, Allah has the power to protect the Imam from the evil of his enemies, but generally, Allah’s custom in this world is to do things in the most normal fashion, using the regular channel of causation. Allah, would not want the Imam to be protected in an extraordinary way.
- A divine secret:
Besides the two mentioned philosophis, some traditions declare that the reason of Occultation is hidden and it is a secret of Allah,
“‘Abd-u-llah bin al-Fazl al-Hāshemī relates, “I heard Imam al-Sādiq to have said, ‘The Imam will necessarily have an invisible life and this is unavoidable. This will lead those who are already astray into doubt.’ So I asked the Imam the reason of it. He said, ‘We (the Household of the Prophet) are not permitted to reveal its secret to you.’ I went on seeking the philosophy behind the invisible life of him and the Imam said, ‘It possesses the same wisdom that existed in prior situations when other Proofs of Allah (the apostles) also went into occultation. However, the true secret behind it will not become manifest until after he has appeared, just as the wisdom behind making the boat defective, killing the boy, and repairing the falling wall [in the story of Moses and Khizr in the Qur'an][3] were revealed to Moses only after the two had decided to part company. O the son of al-Fazl! The subject of Occultation is related only to Allah and is a divine secrets, it is a concealed matter whose knowledge is only with Allah. Since we regard Allah the Exalted, the Glorified to be Wise, we must also affirm that His acts are based on that perfect wisdom, even when the detailed understanding is not accessible to us.” [4]
This hadith points to the fact that the main reason for Occultation is not explained to people because they have no preparation to grasp it, or because of other reasons. We have to keep patience with the issue and the Imam will inform us about the reason when he comes.
- To test people during the Occultation:
Let us end this answer by saying that one of the possible wisdoms for Occultation is that Allah wants to test us then we would realize how firm we are in our faith. If the Imam is not visible, do we act in accordance to our religious responsibilities or we would lose hope and stop continuing.
In a narration from the Holy Prophet its reason is stated saying,“He will go into hiding in order to distinguish those who are misguided (from others). (His occultation will last so long that) ignorant people will say that there is no need for Prophet's household.”[5]
[1] Bihār al-Anwār, by Allāma Majlesi, vol. 51, p. 152, hadith 1.
[2] Al-Kāfi, by Kuleyni, vol. 1, p. 338, hadith 9.
[3] The Quran, 18:71 to 82. In these verses the prophet Khizr performed the mentioned three actions, the Moses who was not aware of the philosophy behind them protested and finally Khizr made him aware of the secret and Moses accepted it.
[4] Bihār al-Anwār, by Allāma Majlesi, vol. 52, p. 91, hadith 4.
[5] Al-Ghayba, by Nu'amani, p. 140.