As it was mentioned Mahdi (PBUH) is away from eyes of people according to Divine will, the one who knows everything. In occultation era he has abundant favor upon Shia and all pious people of other religions. He has helped Shia and other people many times, and in this era hundreds of people have succeeded in meeting him. There are two periods of occultation considered for him: The first one is called minor occultation and the other is called major occultation. The minor occultation (almost 69 years) happened in the third century (after Hijrah). In this era he contacted people by special men. These persons, who were four, were known as the special deputies (Nowwab Khas). They became the special deputy of Imam Mahdi (PBUH) one after another, but after the demise of the last deputy he becomes away from eyes of people for an unknown period which has last till now. He lives among people and when he reappears many people say that they have seen him before but, hadn't known him. Some people renounce his occultation and have doubted about his existence. There is a brief answer to their claim. Not seeing something does not mean that it doesn't exist. No wise person can deny a concept like soul which no one can see it.
All the concepts which exist in Islam are according to wisdom. But there may be some concepts which our wisdom can't say anything about. If we face a fact in religion, which our wisdom and our limited insight neither can prove it nor can renounce it definitely, so we should accept it. Because firstly the religion is based on wisdom secondly, insight of man is confined to time and place, and the only one who there is no end to his insight and knowledge is almighty Allah (SWT) - our creator.
This preface was mentioned in order to generalize this proof for the claim of some people about occultation. Occultation and some other concepts are related to Divine reason (Hikmah) and are not known to man perfectly. However there are some reasons and effects for occultation, which will be briefly mentioned. It is should be mentioned that the Divine reason of this concept is not known for man.
As we know Moses (PBUH) grew up in Pharaoh's palace, while he knew nothing of this child and his ancestors. According to divine will Moses (PBUH) grew up and continued his life. Likewise according to divine will the savior is away from access of oppressors and this divine savior is kept on earth, otherwise he would have been martyred like his ancestors.
It is obvious that he shouldn't obey oppressors, but he should only obey Allah (SWT) in order to reach the final victory. But if like his ancestors he is made to pretend the obedience of the oppressors to keep his life and religion, he would never reach this goal. So if he is not obedient to no one except Allah (SWT) naturally in the existing situation he should be away of the eyes of people.
It is a Devine rule to examine people. Occultation is a way of examining people. In this way the people who are more insistent in their beliefs will be successful in this examination. On the other hand the people who have weak beliefs doubt about this concept and put aside divine religion. This is a way to know people whether they are believer or not.