Prayer is humanity praying to Deity. The flesh part of Jesus was completely man, but in the man Jesus dwelt the fulness of God (John 3: 34: For he whom God hath sent speaketh the words of God: for God giveth not the Spirit by measure unto him. Colossians 2: 9: For in him dwelleth all the fulness of the Godhead bodily.), so when Jesus prayed, His humanity communed with the Deity that dwelt within Him, and the Father (which is the Holy Ghost [Matthew 1: 18]) that dwelt within Him would then respond to those prayers.
The principle is exactly the same for us as sons and daughter of God. When we pray, our humanity speaks to the Spirit (which is the Father) dwelling within us, and the Spirit dwelling within us hears our prayers and responds to them accordingly.