Our prayers and the glorification of God are inextricably connected. Certainly God does not need us to be glorious, but He chooses to be in relationship with us through faith in Christ and prayer gives Him glory. This is crucial when one considers that God is passionate for His glory (Isa 48:9-11) and our lives are meant to be lived for that very purpose (1 Cor 10:31; Col 3:17), which is the most joyful life imaginable (Phil 1:19-23).
Prayer is about dependency and faith. We are to come to Jesus as dependent children looking to our Father to supply everything we need. And prayer is not just about coming to a cosmic Santa Claus to attain all of our worldly desires, James warns against this (4:1-3). Indeed intercession and requests for particular needs are a part of prayer, and God is happy to be the Giver, but He does not desire to be used as a means to an end. Our prayers must ultimately be rooted in our hunger for God, seeing that He is the ultimate joy in all of our joys (Psalm 43:4). This kind of prayer, regardless of what we are pleading to God for, must be founded in faith that our God is the God of the Bible who has shut the mouths of lions, parted seas, put down mighty kings, struck armies, and delivered in miraculous ways. Read the Bible, know that God, and pray to that God as if the Bible is true (because it is).
When we come to God in dependence and faith He is magnified because the Giver gets the glory. We are dependent, He supplies, we find our joy in Him, His renown is declared throughout the earth. This is an important lesson as it relates to prayer, we must not let it degenerate into a time where we only come to God in crisis to get us out of a bind or to fulfill our own selfish desires. Prayer is for the glory of God, namely, to see Him act on behalf of His needy people who are, above all, seeking the advancement of His kingdom for the magnifying of His great name (Matt 6:33).