Thanks for your question and the chance to tell a Soap Opera-level tidbit of history. There is a lot to unpack here, but we will go through a very brief history of the position, on to the promised juicy bit, and then round over to some of the changes to the popular and fictional view of the position.
The position of Visier evolved from the role of a kind of aide or helper and literally means "Burden Carrier" - think Sancho Panza or Terry Gilliam's 'character' in Monty Python and the Holy Grail - and is mentioned in the Qur'an. Aaron was a 'wazir' to Moses, for example (19:53). Though I am being only slightly flippant about the position, it is notable that the Qur'an also regards Aaron (Harun) as a Prophet in his own right, with inspiration and revelation from God. This is important because, relatively quickly, the position becomes very important, evolving into a secretary to the Caliphs and, especially in the Abbasid Caliphate (long before the Ottomans) becomes a very important court functionary and prime adviser to the Caliph. Which brings us to the tale of Ja'far ibn Yahya Barmakid.
Ja'far was the son of a previous Vizier from a well-respected and reasonably well-connected Persian family that had converted from Buddhism to Islam in the early years of Muslim Arab conquests. Ja'far was Vizier to Harun al-Rashid, the Arab Caliph, but from what I've read, he was considered a 'friend' insofar as al-Rashid saw anyone as a friend. Ja'far was an important element in promoting learning and trade to Baghdad by promoting paper manufacture (recently learned from the Chinese), enticing Indian polymaths to come to Baghdad, and promoting trade to make Baghdad one of the most influential cities in the Middle East; for example Muhhamad ibn al-Kwarizmi codified and promulgated systemic to Algebraic equations and more at the House of Wisdom (Bayt al-Hikmah) in the years after Ja'far's death precisely because of the reputation of Baghdad as a learned center of the world. Additionally, he (Ja'far) put down rebellions in some provinces, launched investigations into incompetence and graft, quieted restive areas with his policies, and generally carried the weight of his position very well.
Harun (Caliph) had a problem, though; he had a half sister on his father's side who he did not want to marry off. There is little contemporary speculation or explicit explanation why, but as the story unfolds, modern scholars have concluded that Harun was attracted to her (or, at the very least, jealously protective of her) and acted the way he did because if he couldn't have her, nobody could (or he couldn't stand the idea of any man touching his little sister, take your pick). However you slice it, though, it was clear that he could neither brook the idea of her being married off nor the scandal of her remaining unmarried. Enter Ja'far, who was also a very close friend of Harun; the two often stayed up very late entertaining each other with stories and games. They hunted together, ate together, and basically were best friends as well as 'co-workers' (so to speak). Harun ordered Ja'far to marry his Abbasa (the sister), but ostensibly forbade them to consummate the marriage. Ja'far and Abbasa, contrary to their instincts for survival, fell in love. Though initially Abbasa would send slaves to Ja'far's room to sleep with him and perform 'wifely duties,' it wasn't enough for the young couple. Eventually, they began to have secret trysts behind the Caliph's back. As a result, Abbasa got pregnant. This, coupled with palace intrigue (Ja'far was a Persian, a Convert, and relatively 'soft' on tamping down Zoroastrians, Buddhists, and other non-Muslims, for example) spelled distaster for not only Ja'far, but the Barmakid family as a whole.
Harun was not a man to be trifled with, however, and flew into a rage once palace rumors inevitably reached his ears. First, he exiled Abbasa (or had her killed; she disappeared from Abbasid records, as far as I know). Ja'far was beheaded, his body desecrated and chopped into bits, then pieces hung on the major bridges leading into Baghdad. Harun then turned on the Barmakid family, siezing their property, throwing them in prison, including the old Vizier Yahya. Then went after anyone and everyone who had ever allied with, defended, or even remotely liked the Barmakid family, resulting in the death of most of the Barmakids and their political allies. It was a literal bloodbath in Baghdad as soldiers went from place to place, killing or arresting suspects. Furthermore, post-mortem official reports and stories of the family decried them as heretics and blasphemers, traitors, corruptors of the youth, and all kinds of bad-sounding, hard-to-disprove rumors and accusations.
So, we have the seed of a vizier who was 'sly,' 'untrustworthy,' and 'conniving.' But something strange happened to Ja'far along the way. The Abbasid caliphate's narrative fizzled out, allowing a Persian (particularly Zoroastrian) narrative to emerge; Ja'far was a smart, wise, insightful hero in those stories. A perfect example of this is in the stories attributed to Sheherezad 1001 Arabian Nights (Elf Layl wa Layl) in which Ja'far is cast as a hero and detective, like a cross between Indiana Jones, Zorro, and Sherlock Holmes. The Barmakids, however, are a little more ambiguous (see "The Barber's Tale of His Sixth Brother"). Regardless, for a thousand years after his death, the name Ja'far was actually pretty well regarded. But the seed is there.
Fast forward to the 18th century and the title of Vizier (and Grand Vizier) is still alive and well in the Ottoman Empire. The character of Ottoman politics is pretty knotty, so I won't go too far into it, but suffice it to say that increasingly during this period, there were successions of easily-manipulated, incompetent Sultans (with a few notable exceptions) who relied upon Viziers to do the actual job of governing. The government was rife with partisan political elements in the court, each vying for power. Some of the Viziers (administrative heads) and Grand Viziers *did* try to reform some of the political, economic, military, and other aspects of Ottoman society, particularly the effort to consolidate rule under the Imperial government (Centralization). However, in a hyper-partisan and polarized political setting, it was difficult to dig out corruption and easy to unseat one's rivals in the favor of the Sultan with a few political tricks and dastardly lies/strategic truths. These tales filtered down, informally and formally, from the top. In the midst of this turmoil, you have political enemies printing or spreading anonymous stories about how traitorous, corrupt, evil, or stupid rivals are in broadsides, newspapers, and other 'media' outlets. This becomes so commonplace in the Ottoman Empire, that stories of self-serving Viziers work their way into literary tropes even outside the Ottoman Empire. And it's kind of fair to see why; Viziers oversaw the implementation of the many and increasingly unfair Captulation treaties, the levying of increased taxes, take-over of local power by Imperial authority, and a load of other unpopular programs in the latter Imperial period (see HERE for /u/RabidPenguin3 a recap of the decline of the Ottoman). While the position of Grand Vizier, especially in the Ottoman Empire, was never really a long-serving one, the turnover rate towards the 19th century was astonishingly fast; some Grand Viziers lasted only a few months. This constant turnover meant that policy was fractured and often contradictory, leading to a lack of faith in the central government's officials, especially the Viziers. It became a vicious cycle; rumors of imcompetent administrators caused lags in compliace with (or outright resistance to) new rules, which would force the resignation (or ouster) of administrators who would come in with new, equally ignored rules.
Moving into the 20th century, film producers in the US and UK inject a little of their influnce into this popular Turkish trope of the corrupt Vizier. Though the one you are most familiar with would probably be Disney's 1992 film Aladdin, but in 1940's The Thief of Baghdad (upon which the former is more closely based), Ja'far is a conniving usurper who seduces a princess and takes the Sultan's throne. Viziers are even a part of the extended Star Wars universe as administrators and puppets of the Empire. Relatively few pop-culture representations of Viziers are in any way popular, and so the downfall of the "Vizier" title is complete.
I hope that helps,a nd entertains, at least a little. If you want to read more on the Ottomans, check out:
The Ottoman Empire by Halil Inalcik
A History of the Ottoman Empire by Douglas Howard
For the Abbasids:
The Great Caliphs by Amira Bennison
The House of Wisdom by Jonathan Lyons
The Middle East by Fischer and Ochsenwald
A kind of related question. The queen in chess in Arabic is called El Wazeer (الوزير), or minister, would that be related to the Ottoman Vizier?
That does not harbor fools
Allow guesses, jokes, or short replies
Where the mods kill your posts
If you break any rules
It's barbaric! (but some find it wise)
~~
When a question gets big
With no answer as yet
Please just wait for experts to arrive
Why don't you give a thought
To PM RemindMeBot
And flip through the Arabian Nights