This graphic from BBC fairly clearly explains the Iranian political system. In that political system, the most powerful figures and bodies are not directly elected, however they are appointed by an elected body, the assembly of experts, which can also remove them from power.
There is clearly room in this system for public debate over policy, with the population able to favor candidates with more popular views. The most undemocratic aspect of the system is the vetting process which is not transparent or independent of the people currently in power. While I would like to see reform of that process, I do not know what vetting process I would prefer. I would not prefer a US-style vetting process, where in order to be a candidate one must raise more money than one's opponents both because the US-style vetting process limits the field of debate just as much as the Iranian style, and also because a pay-for-vetting system would introduce the risk that foreign parties, such as the US, could inject enough money into Iran's political process to capture it, and even install another pro-US dictator as was the case with the Shah.
As it is though, Iran's Supreme Leader is not a relative of its previous Supreme Leader, and not the favorite choice of powers foreign and hostile to Iran, but a politician who by the consensus of a wide group of Iranian decision-makers, was at the time of his selection the individual best suited to be the leader of Iran. For this reason, while Iran's Supreme Leader is not directly elected, his tenure in that position is the result of a competitive political process that ultimately takes Iranian popular values and interests into account.
Any comparisons between Iran's system of leadership and the leaderships of members of the constellation of pro-US dictatorships in the region - Saudi Arabia, Egypt, Jordan, Kuwait and others - are just nonsense, often produced by people who should know better.