Ayatollah is a title given to clerics who specialize in Sharia interperetation, and are therefore essentially legal scholars. A Mullah is a cleric who has a particular reputation for interperetation of the Qu'ran and Hadith, but is not a legal scholar. The word "cleric; gets used becasue westerners have a difficulty understanding a religion without a "clergy." Cleric is a catchall phrase for a Muslim who has some study of Qu'rana dn Hadith and who may preach or teach.
In addition, Ayatollah is primarily a Persian title, although it does show up once or twice in records of the Baghdad Caliphate prior to the 11th century. Grand Ayatollah is a mostly political term utilized in the late 20th and early 21st century. I consider Grand Ayatollah to have about as much valisdity as "Great Grandmaster, Supreme Grandmaster (all of them self promoted), etc.." does in the martial arts.
Have you access to
The Oxford History of Islam? If not, I reccomend it.
This is a fairly good Sunni page:
Webpage Title
But take it wth a grain of salt, since it is essentially a proselytizeing page, rather than an academic source.