He rules because the Iranian constitution is designed in such a way that all
major political authority, ultimately, rests with him.
Article 110 of the Iranian Constitution:
Article 110
Following are the duties and powers of the Leadership:
- Delineation of the general policies of the Islamic Republic of Iran after consultation with the Nation's Exigency Council.
- Supervision over the proper execution of the general policies of the system.
- Issuing decrees for national referenda.
- Assuming supreme command of the armed forces.
- Declaration of war and peace, and the mobilization of the armed forces.
- Appointment, dismissal, and acceptance of resignation of:
- a. The fuqaha' on the Guardian Council.
b. The supreme judicial authority of the country.
c. The head of the radio and television network of the Islamic Republic of Iran.
d. The chief of the joint staff.
e. The chief commander of the Islamic Revolution Guards Corps.
f. The supreme commanders of the armed forces.
- Resolving differences between the three wings of the armed forces and regulation of their relations.
- Resolving the problems, which cannot be solved by conventional methods, through the Nation's Exigency Council.
- Signing the decree formalizing the election of the President of the Republic by the people. The suitability of candidates for the Presidency of the Republic, with respect to the qualifications specified in the Constitution, must be confirmed before elections take place by the Guardian Council; and, in the case of the first term [of the Presidency], by the Leadership.
- Dismissal of the' President of the Republic, with due regard for the interests of the country, after the Supreme Court holds him guilty of the violation of his constitutional duties, or after a vote of the Islamic Consultative Assembly testifying to his incompetence on the basis of Article 89 of the Constitution.
- Pardoning or reducing the sentences of convicts, within the framework of Islamic criteria, on a recommendation [to that effect] from the Head of judicial power.
To recap:
1) The Supreme Leader sets the general policies of the Iranian state in conjunction with the Exigency Council. The Exigency Council is appointed by the Supreme Leader.
2) The Guardian Council has the ability to veto any legislation passed through the Iranian Parliament (Majlis).
3) Half of the Guardian Council is appointed by the Supreme Leader.
4) The other half are appointed by the Majlis. However, members of Parliament, like anyone running for a political office, must be approved by the Guardian Council.
5) Anyone who is running for office in the first place must swear allegiance and loyalty to the Supreme Leader.
6) If a dispute arises, the Expediency Discernment Council is tasked with resolving it. The Expediency Council also acts as a conduit between the Supreme Leader and all branches of government, ensuring they are not conflicting with his agenda.
7) All members of the Expediency Council are appointed by the Supreme Leader.
8) The President can be removed by the Supreme Leader if the Supreme Court concurs.
9) The Supreme Leader controls appointments to the Supreme Court.
So, I'm not sure where your claim that Khamenei only holds power through consensus is coming from. It sounds to me like he has a pretty solid hold on power regardless, even if he lacks the force and charisma of his predecessor.
As for Mousavi, if you can show me where he's presented himself as a serious challenge to Khamenei's authority (which would make it hard to see how he was permitted to run by the Guardian Council), or where that perception gained traction, I would be interested in seeing it.