A behind-the-scenes power broker with deep ties to Iran’s security establishment now sits at the top of the Islamic Republic.