What Christians believe, what the world says Christians believe, and what the Bible says are different things at times.
We have a fallen nature. This can be observed outside of Christianity. Ask any very little child which you know has done something wrong who did that thing and their nature is to try to avoid telling the truth or to lie or to blame others.
The Bible says in Rev. 3:5 He that overcometh, the same shall be clothed in white raiment; and I will not blot out his name out of the book of life, but I will confess his name before my Father, and before his angels. Also see Ps. 69:27-28.
To me, this says that the names are all written there initially. This is consistent with the Christian view that until an age that a child knows right from wrong that child would go to heaven when it dies. At some point though, every child must make a conscious choice to do right or wrong - to commit sin or not.
God's Holy Spirit - the conscience in colloquial terms - tells the right path. If the child ignores the prompting of the Holy Spirit and sins, their name is blotted out. I'm not sure where God's grace draws that line for when that happens - where the failure to overcome is. I only know that the Bible says at some point God will blot out that name due to failure to overcome sin. If a person doesn't develop an ability to mentally process right/wrong due to disorders of the mind, I believe God's grace extends longer.
God's grace can be reacquired by accepting Christ as Savior. The sin is still there but the person has been justified by the sacrifice that Jesus made. He is made "just as if" he or she had never sinned in the first place. People can and do turn their backs on this salvation either before accepting it in the first place or at some point afterward. Again, at some point the name can again be blotted out if they forsake this great salvation.
Romans makes clear that God will judge those who have never heard of Christ according to how they have responded to the Holy Spirit's promptings in their hearts when presented with the choice to do right or wrong. Those who have heard of Christ and have rejected Him have no such out. Once you've heard of Christ and decided He isn't for you - you face God's judgment fully upon death with no second chances.
I don't know if that helps, but God is just about as fair and generous as He can be. And among all religions I know of, Christianity is the only one where a member of the Godhead Himself sacrificed first His heavenly station, and then His life for His creation. Due to God's own sacrifice on the cross, His standards and expectations are justifiably higher.