In islam, our fundamental relationship with Allah is Rabb (Lord/Master) & Abd (slave). The thing about a master is that you don’t negotiate with a master. You negotiate with an employer; you can also negotiate with a partner; you can negotiate with a family member. When there is a master and slave, who negotiates all the terms? The master. The slave’s only position is to follow all these terms. The other thing about a master is that if he gives you something, it is a bonus and if he does not give you something, he did not have to. Because you are not salaried. You are a slave. Slaves are not salaried. Usually when you think of masters, they are oppressive; you think of chains, beatings, etc. that is human masters. Allah is a different kind of master. He is the only kind of master. As Allah states in soora Fatiha: this is the kind of master that before you even know that He is your master, you know that He deserves praise and gratitude. No other master deserves praise and gratitude right off the bat. The first thing you think of a master is someone you should praise; someone you should be grateful to. The only thing a slave would think of is when can I get free of this guy? But for Allah, all you think is praise and gratitude. Now coming to the idea of why Allah does not give me a perfect life. The question assumes that Allah owes you something. Like an employer who owes you something. i.e. your pay-cheque. Your business partner owes you something, your cut. Your parents owe you something. They are responsible to raise you. Your children owe you something, your wife, husband, they owe you something. Allah owes you nothing. He does not owe you anything. As a manner of fact, you owe Him every breath. So when you phrase this question, I should have a perfect life, you have already undercut the idea that Allah is your master, like you are in some sort of position to make demands. Right? When you take that away, it is an uncomfortable thing. ‘’I want God to be my friend; I want Him to be someone who helps me like I pray to Him.’’ You want to dictate what this relationship should look like similar to any relationship, friendship. There are different kinds of friendship. I talk to some friends different from other friends. So in every relationship, we figure out what is going to be the give & take. Some figure they should figure out what their relationship with God is going to be like. For example, they say: I am going to do this for Him, He’d better do this for me. The give & take. The bigger problem with this kind of attitude is you are deciding what the terms are. To put this into perspective, who should decide what the terms are between you and the supreme being? -The one who knows everything. His terms override yours. What you have in mind is less relevant and what He dictates is far more relevant. This might sound harsh, but if you give His terms a chance, for example if you study Quran. Quran is His terms. Here is what it means to be my slave. When you study quran, you find that it is not a book of do this or If you don’t do this, this is going to happen. As a matter of fact, for the most part, it is the relationship of loyalty, gratitude, love, friendship, remembrance, longing. It is a really beautiful relationship. This Master wants me to be a slave who loves Him, who is friend with Him, who talks to Him all the time, remembers Him all the time. He says: remember Me, I will remember you. Who talks like that? That doesn’t sound like a master. right? So Quran shatters your view of what Allah means as a Master. He wants to be your Friend; He wants you to be His friend. But first understand that He is your Master. Then understand that He is your friend. He wants to be a giver of gifts to you, but before He gives you gifts, He wants you to understand that He is your Master and you are the slave and He wants to give gifts to you. He wants to show you love; He wants to show you mercy, forgiveness, wisdom, knowledge. He wants to give you all these stuff. He wants to teach you. He wants to be your teacher too. He wants all of these things. All these relationships. So it is not one relationship. It is a lot of relationships. But at the helm of them all, He is the Master & you are the slave. Which means whatever happens in this relationship, your humility should never go away. Because the idea of slavery is: it is the most humble job description in existence. There is no more humble a job than a slave; you can’t get lower than that. These questions lack humility because they reek of entitlement. “I want, I want, I want” you could still want, but you if you want as a slave, it is different than when you want as someone who is entitled. Allah is not saying you cannot ask. You can ask, but He will decide when to give & what to give. So the answer to this question isn’t actually what Allah decides to do or not to do, but how we perceive Allah ourselves. The problem lies in our perception, so when you correct the perception, the problem is solved. People -around the prophet pbuh- who did not believe. If you were to ask them who made the skies and the earth. They would say Allah. They have no problem accepting Allah as the creator. Ask them who the master is. There is silence because that requires me to be a slave. If I call Him the Master, this makes me slave, makes me humble. If I ask you who made this car and you say lexus or honda. I can accept that. Who is your boss? Who is your ultimate authority? But who owns the car? That is my car. This is the line that has to be crossed when somebody enters into islam. They have to accept Allah as Rabb (Master), they have to accept themselves as slave.
Source: https://www.youtube.com/watch?v=S047WdXLLa0