John 15:7 says, if you abide in me and my words abide in you, you ask what you desire, and it shall be done for you. Jesus specifically defined abiding as His Word abiding in us with a promise that this will help us pray prayers that God will answer. Abiding in God's word strengthens our relationship with Jesus, and it renews our mind.

Romans 12:2 says, do not be conformed any longer to the pattern of this world, but let God renew your mind. We do that through the Word of God, and this is what transforms us. This transforms us, changes us into new people. Our thoughts and our desires are aligned with God's thoughts and desires.

So when we pray, he answers yes, because we're praying things he wants to happen.