1) John uses the verb "remain" forty times in his Gospel and twenty in 1 John; it is a favorite verb. Not all uses of course concern "remaining in" God or Jesus or the word or the like (e.g., μείνατε ἐν ἐμοί, "remain in Me," John 15:4). See below for a partial list (where as in other points below, "remain" = "abide" = "continue").
2) "Vine" and "vineyard" imagery is used in the OT (e.g., Isaiah 5), Synoptic Gospels (e.g., Mk. 12), and outside the canon (e.g., Gospel of Thomas), but not all in the same way. In John 15, Jesus is the vine rather than, for example, the vineyard worker or owner.
3) In John 15:1-11, John develops his (or rather Jesus') vine metaphor so that for example "remaining in Jesus" language draws on the analogy of a branch abiding in the main vine, as it were to receive sustenance necessary for the life of the branch; the believer is the branch and Jesus is the vine into which the branch is grafted. Such metaphorical picture may or may not be intended in Johannine "remaining in Jesus (etc.)" language outside John 15, though the idea of faithfulness and continuation would seem to carry through.
4)
Remaining in Jesus requires obedience to Jesus' commandments (John 15:9-10, 1 John 3:24--"The one who keeps His commandments abides in Him, and He in him," 1 John 2:6--"the one who says he abides in Him ought himself to walk in the same manner as He walked," cf. "If you love Me, you will keep My commandments," John 14:15).
And
at the same time, remaining in Jesus is necessary to producing fruit (John 15:4-6) which glorifies God (John 15:8) and which (fruit) would include obedience.
Remaining in Jesus is a vital, life-giving and loving relationship as well as an obligation. "Just as the Father has loved Me, I have also loved you; abide in My love. If you keep My commandments, you will abide in My love; just as I have kept My Father’s commandments and abide in His love" John 15:9-10. "If we love one another, God abides in us," 1 John 4:12.
5) In John 15:7 as elsewhere, remaining in Jesus is tied to Jesus' words remaining in His disciples ("if you remain in Me and My words remain in you"). "So Jesus was saying to those Jews who had believed Him, “If you continue in My word, then you are truly disciples of Mine," John 8:31. Or by contrast, "You do not have His word abiding in you, for you do not believe Him whom He sent," John 5:38. "Remaining in His word" language means faithfully obeying, believing, confessing, communing (see the verses list below).
6) Verses List. See for yourself (from NASB translation and note again that "remain" = "abide" = "continue" in the Greek original).
John 5:38 You do not have His word abiding in you, for you do not believe Him whom He sent.
John 6:56 He who eats My flesh and drinks My blood abides in Me, and I in him.
John 8:31 So Jesus was saying to those Jews who had believed Him, “If you continue in My word, then you are truly disciples of Mine;
John 14:10 Do you not believe that I am in the Father, and the Father is in Me? The words that I say to you I do not speak on My own initiative, but the Father abiding in Me does His works.
John 15:4-7 Abide in Me, and I in you. As the branch cannot bear fruit of itself unless it abides in the vine, so neither can you unless you abide in Me. I am the vine, you are the branches; he who abides in Me and I in him, he bears much fruit, for apart from Me you can do nothing. If anyone does not abide in Me, he is thrown away as a branch and dries up; and they gather them, and cast them into the fire and they are burned. 7 If you abide in Me, and My words abide in you, ask whatever you wish, and it will be done for you.
John 15:9-10 Just as the Father has loved Me, I have also loved you; abide in My love. If you keep My commandments, you will abide in My love; just as I have kept My Father’s commandments and abide in His love.
1 John 2:6 the one who says he abides in Him ought himself to walk in the same manner as He walked.
1 John 2:24 As for you, let that abide in you which you heard from the beginning. If what you heard from the beginning abides in you, you also will abide in the Son and in the Father.
1 John 2:27 As for you, the anointing which you received from Him abides in you, and you have no need for anyone to teach you; but as His anointing teaches you about all things, and is true and is not a lie, and just as it has taught you, you abide in Him.
1 John 3:6 No one who abides in Him sins; no one who sins has seen Him or knows Him.
1 John 3:24 The one who keeps His commandments abides in Him, and He in him. We know by this that He abides in us, by the Spirit whom He has given us.
1 John 4:12-16 12 No one has seen God at any time; if we love one another, God abides in us, and His love is perfected in us. 13 By this we know that we abide in Him and He in us, because He has given us of His Spirit. 14 We have seen and testify that the Father has sent the Son to be the Savior of the world. 15 Whoever confesses that Jesus is the Son of God, God abides in him, and he in God. 16 We have come to know and have believed the love which God has for us. God is love, and the one who abides in love abides in God, and God abides in him.
7) Thus to bear fruit to the glory of God, disciples must continually draw life from Jesus the Vine; Jesus gives the life necessary for communing with, trusting, obeying, loving. And the disciples are commanded to bear fruit faithfully, obey, trust, and love God and the brothers (meaning brothers and sisters) in Christ. Or as Paul says, "work out your own salvation with fear and trembling, for it is God who works in you, both to will and to work for His good pleasure" (Phil. 2:12-13 ESV).
If the disciple of Jesus continually draws life from Jesus and loves and obeys Him, s/he will walk as Jesus walked in the good pleasure of the Father, and whatever such person asks in prayer will willingly be in accord with what God wishes, hence "it will be given you."