Prophethood and Imamat were instituted to guide people towards the right path, dissuade them from vanity, restore human qualities, suppress the evil temptation of ones self, living peacefully, curb and eliminate evils such as jealousy, enmity, pride etc. and also to encourage qualities such as self-sacrifice, understanding other and preferring others over ones own self. In short, perfecting all human qualities and to draw people towards the stage of self-actualization.
Irrational desires are obstruction to guidance
For overcoming avid desires one must seek guidance from a pure soul, who is free from every blemish. Prolonged and irrational desires are so forceful that it attracts a person to itself without giving him the opportunity for evaluating its drawbacks.
At the beginning, he is carried away but at a later stage he finds
himself in a situation where he cannot see light at the end of dark
tunnel and ultimately is destroyed by it. For safe sailing a rational
attitude to differentiate between ones desires and inclinations. This
cannot be achieved instantaneously. Man climbs the ladder of
consciousness slowly and through sweet and sour experiments,
civilization has progressed steadily and has reached to present stage
where it is perceived to be in final stages of perfection. But one area
which is grossly neglected is purification of soul. When intellect will
get perfected man will automatically realize this important aspect and
will develop his hidden conscience. At that time, the movement will be
towards true religion which has a pious leader to provide guidance,
slowly when man will realize the system of his creation he will
relinquish the worship of other objects and will turn towards almighty
Showing people the straight path, that could lead them towards salvation, was the aim of all the prophets and their successors and especially of our Holy Prophet (s.a.w.a.) who was deputed as guidance and mercy for entire mankind. He established the faith and religion, but the work of protection and interpretation was entrusted to his vicegerents. Circumstances were so created that it became impossible to implement and implant lofty ideals of Islam and to spread light of Islam to every corner of world. Matter reached to such a position that they were forced to remain silent or unsheathe their sword for a combat. The choose to remain silent and avoided unnecessary bloodshed of muslins, even though it was their right to fight for it, they did not took such a step because people were new and were not oriented to ideals of Islam. Let me put it in words of Ameerul Momineen Ali (a.s.):
Then I began to think whether I should assault or endure calmly the blinding darkness of tribulations wherein the grown up are made feeble and the young grow old and the true believer acts under strain till he meets Allah (on his death). I found that endurance thereon was wiser. So I adopted patience although there was pricking in the eye and suffocation (of mortification) in the throat
(Nahjul Balagah, Sermon No. 3)
Similar situations were faced practically by each and every Imam. For this reasons, Imams (a.s.) concentrated all their attentions on preaching and propagating religion and simultaneously training his companions as examples to be emulated. Due to this true religion remain protected in form of books and practically in form of his companions. Today, what we witness of religion is the outcome of their effort. Their influence was such on people that pseudo scholars and despotic rulers were forced to apparently proclaim Islam.
Work of establishing and implementing religions teachings was entrusted to last Imam, who on his reappearance will strive to enforce principles in toto. Everybody will receive guidance from charismatic leader who will replace injustice with justice and ignorance with guidance. Because of this he is called 'Mahdi'.
Guidance in every arena
Guidance regarding inclinations, way of thinking, ethics and various actions performed in due course of life. Guidance for individual and for society at large. Guidance in matters of this world and of hereafter are some aspects in which man is in need of guidance. Depression, famine, earthquake, corruption and designation of calamites result from sins committed by man. If this sins are rectified then prosperity will reign and this will require guidance.
In traditions, Imam-e-Asr (a.t.f.s.) is called Mahdi because "he will guide people towards hidden matters and he will be aware of secrets and apparent in universe, even the things mentioned, in far corner of a room will be known to him."
As per other tradition he is called 'Mahdi' because he will lead people towards thing which are unknown to them.
(Behaarul Anwaar, vol. 51, pg. 30)
Jabir-e-Jaufi narrates that while he was in presence of Imam Muhammad. Baqir (a.s.), one person came and gave him 500 Dirhams as Zakaat and requested him to accept it. Imam (a.s.) asked him to spend it on his neighbors, orphans and poor people, as giving Zakaat to a Imam of time will become obligatory only when Qaem will reappear, he will act with justice and equity and the one who obeys him is like one who obeys Allah and his rejection will tantamount to rejection of Allah.
He is called 'Mahdi' because Allah will guide him towards secrets of universe. Hidden treasures will come to fore and he will invite people to appropriate wealth for which they used to shed blood, break the ties and resorting to prohibited things. He will be bestowed with a position not bestowed to anyone before.
Holy Prophet (s.a.w.a.) said that he is from me and bears my name. He will protect my religion and establish my traditions. He will fill the earth with Justice and equity as it will be filled with injustice and oppression
(Behaarul Anwaar, vol. 51, pg. 59)
May be title 'Al-Mahdi' is attributed to him as he shall light the lamp of guidance, whose light will spread in every corner of world.
Some people argue that 'Al-Mahdi' means 'Guided One' and work of a guide is to lead people and to guide them. Based on this Imam Mahdi is 'Guided one' and not a guide.
A simple straight forward reply to this is that a person who is possessor of guidance can only guide others towards right path. A retainer of guidance can only guide people in their affairs. A teacher cannot, teach a subject to his students unless and until he himself has full command over the subject.