The promise “I will not erase his name from the book of life,” does not necessarily imply that some do have their names erased. It simply says to the one who is in the book and who conquers in faith: I will never wipe out your name. In other words, being erased is a fearful prospect which I will not allow to happen. I will keep you safe in the book. That is one of the promises made to those who persevere and conquer. It does not say that those who fail to conquer and fall away from Christ were written in the book and got erased.
In fact, there are two other verses in Revelation that seem to teach that to have your name written in the book means that you will most definitely persevere and conquer. Consider Revelation 13:8. “And all who dwell on the earth will worship the beast everyone whose name has not been written from the foundation of the world in the book of life of the Lamb who has been slain.” This verse implies that those whose names are written in the Lamb’s book of life “from the foundation of the world” definitely will not worship the beast. In other words, having our name in the book of life from the foundation of the world seems to mean that God will keep you from falling and grant you to persevere in allegiance to God. Being in the book means you will not apostatize.
Similarly consider Revelation 17:8, “The beast that you saw was and is not, and is about to come up out of the abyss and to go to destruction. And those who dwell on the earth, whose names have not been written in the book of life from the foundation of the world, will marvel, when they see the beast, that he was and is not and will come.” Again having one’s name written in the book of life from the foundation of the world appears to secure one from “marveling” at the beast. Those whose names are not written in the book of life from the foundation of the world will marvel. If your name is written there, you will not marvel at the beast.
The teaching here is that having one’s name written in the book is effectual. That is, it has a defining effect on one’s responses. To have your name written in the Lamb’s book of life from the foundation of the world guarantees that you will not worship or marvel at the beast. John does not say, “If you worship the beast, your name is erased.” He says, “If your name is written, you will not worship the beast.”
Mainly addressed within the context of Old Covenant Israel. Old Covenant Israel was broken off due to its unbelief. The text does not say that the Israelites believed and then fell away, or any such corollary to justification. The Jews were given a covenant and swore to obey it. They didn’t, and were broken off. The warnings to Jewish and Gentile Christians are to not be like they were. It is these sorts of warning in Scripture that assist in making sure the believer does not fall away. We are given the grace, and it is strengthened by, meditating on these instructions from the Lord.