Perseverance is necessary for final salvation, yet all true saints will persevere because we are kept by the power of God. This is the doctrine of the perseverance of the saints which is, in my view, the best way to accommodate the variety of verses found on this topic. There are numerous scriptures making the point that salvation is eternal, that Jesus will not lose even a single one of his sheep, that his sheep will never perish, that we are kept by the power of God, etc.
However the bible is also full of warning about not falling away. I think these are here because, within every church, in that era and this one, there are false converts. False converts can be discovered because they fall away. Only the true sheep stay and abide. I think these warning are given to illuminate the need for repentance in those who falsely claim Christ, and to encourage those who are true by means of revealing the enduring nature of their faith.
Here's the problem with the idea that salvation can be lost; it would mean we work for our salvation. If we could lose our salvation, then we are not saved at the moment we repent and believe, we are saved if we make it to the end. Therefore we have to work our tails off and hopefully make it to the end, and hopefully be righteous enough to be saved. Hence, self-righteousness. If this were true, those who make it could boast, because they held on and kept on in righteousness. If salvation depended on human effort, or holding on in any way, then salvation would be of man and not all of God. This is a serious error.
"All that the Father gives Me will come to Me, and the one who comes to Me I will certainly not cast out. For I have come down from heaven, not to do My own will, but the will of Him who sent Me. This is the will of Him who sent Me, that of all that He has given Me I lose nothing, but raise it up on the last day. For this is the will of My Father, that everyone who beholds the Son and believes in Him will have eternal life, and I Myself will raise him up on the last day.”
- John 6:37-40
Jesus Christ came to do the will of the Father, and he will do it. None of his sheep will be lost.
"My sheep hear My voice, and I know them, and they follow Me; and I give eternal life to them, and they will never perish; and no one will snatch them out of My hand."
- John 10:27-28
Again, none of his sheep will perish. I don't think he could have stated it any more plainly.
"who are protected by the power of God through faith for a salvation ready to be revealed in the last time."
- 1 Peter 1:5
What is the nature of this faith?
"For by grace you have been saved through faith; and that not of yourselves, it is the gift of God;"
- Ephesians 2:8
So we are protected by the power of God through faith, and this faith is itself a gift of God. God gives us an enduring faith, a persevering faith.
But what of those who were 'Christian' but fell away and became, say, atheists? Did they lose their salvation?
"They went out from us, but they were not really of us; for if they had been of us, they would have remained with us; but they went out, so that it would be shown that they all are not of us."
- 1 John 2:19
Again, one who is truly in Christ endures, abides, and perseveres.
Now lets step back and take a big-picture look at the whole drama of salvation.
"and these whom He predestined, He also called; and these whom He called, He also justified; and these whom He justified, He also glorified."
- Romans 8:30
This is an unbroken chain from predestination, that is being chosen of God in eternity past, to being glorified. No one slips through the cracks; no one is called but not justified, no one is justified but not sanctified, and no one is sanctified but not glorified. All of God's elect will be glorified.
To sum this up, all true saints will persevere in faith until the end and will enter into glory. This does not mean that one can live absolutely any way they like and have no fear of Hell. A child of God will bear fruit and will not walk in darkness. 1 John makes a clear delineation between the true sheep and the false converts. That's why I don't call this doctrine "eternal security" as some do; perseverance of the saints is the biblically accurate name for this truth. We are saved because we have a supernatural, enduring, persevering faith in Christ given by God. All who completely and finally 'fall away' never had this real faith to begin with, and any with a real faith who fall away will come back in repentance.
Salvation is all of grace, from start to finish. No human works, either in earning salvation or keeping it, have anything whatsoever to do with redemption. Christ bore our sins in his own body and died under the wrath of God, as a propitiation for the sins of all who would ever believe in him. To say one of these could lose their salvation would be to say that Christ died for nothing and did not propitiate the wrath of God for this sins of his people. On the cross, Christ cried out "It is Finished!". He was right. Salvation is a gift of God by grace through faith. No one given to Christ by the Father will be lost.