If you abide in me and my words abide in you, ask whatever you wish, and it shall be done for you. He gets glory as the one who is rich and good enough to answer prayer. But also . . . The implication is that God gets glory when we bear much fruit because we have prayed and God has answered. Therefore the primary point of prayer is fruit-bearing.
Prayer is for fruit-bearing.
This is confirmed explicitly in verse 16. The logical connection between the two parts of this verse are tremendously important. Jesus says that he chose and appointed his disciples that they should go and bear fruit that remains . . . This only makes sense if prayer is for fruit-bearing. Prayer is for fruit-bearing.