system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: The relationship between Iran's Ayatollah Ali Khameni and their president and who actually governs what?
gpt
The Iranian political structure is amazingly redundant, with checks and re-checks all over the place. No one person has the final say in anything with one exception...the Ayatollah. There also exists a dual military structure wherein there is a normal, regular military, paralleled by the IRGC, Islamic Revolutionary Guard Corps. The IRGC receives much more funding, are hand picked for their support of the Ayatollah, far better equipped, and loyal as fuck. The president is responsible for most day to day activities, but is more intended to be the public face of the Ayatollah's direction. Ahmedinijad has, at times, broken from that direction, and seemed to invite a sort of power struggle. The IRGC arrested him and reportedly brought him before the ayatollah last month, and about the events of that time speculation abounds, but it seems clear that he was basically told fall in line or fall off the face of the Earth. 

Additionally, the president is "elected," but must as a candidate be approved to run by the Ayatollah. The elections are therefore subject to the Ayatollah's whims, and they have been swung in various directions by such whims. The Ayatollah is, conversely, appointed through the words of the previous Ayatollah, essentially a named successor.