When Sultan Mahmud, King of Ghazni, first came across the slave Ayaz and his owner, the Sultan asked the owner of Ayaz, “Why are you selling this slave for such a high price?” The owner replied, “Because he knows how to be a slave.” Impressed with the response, the Sultan paid the price and bought the slave, Ayaz.
After the transaction was complete, the Sultan ordered his guards to whip the slave, Ayaz, 100 times. And while this was going on, the Sultan told one of his ministers to go to Ayaz and whisper in his ear to plead with the Sultan to stop the whip. So the minister went up to Ayaz and said to him, “Ask the Sultan, ‘O Sultan, why are you whipping me when I have done nothing wrong?’” At this, Ayaz replied, “I cannot do that, Sir, because the Sultan is my master and I am happy with whatever my master does with me.”
The minister reported back to the Sultan and when the Sultan heard the answer of Ayaz, he said, “If that is his answer, then I really bought him at a very cheap price.” Thereafter, the Sultan would ask, “Oh, Ayaz, what type of food would you like to eat and what type of clothes would you like to wear?” And Ayaz would reply, “Whatever my master gives me as food, I will eat and whatever my master gives me to wear, I will wear.”
And it was because of this attitude that Sultan Mahmud began to love the qualities of his beloved Ayaz. So much so that he eventually made Ayaz the chief minister of his court.