According to 1 John 2:2, Jesus atoned for the sins of the whole world. According to John 3:16, God limited the benefits of the atonement only to those who would trust in his Son Jesus. In other words, God has made it possible for all to be saved, but has made that salvation conditional.
In the case of children and babies, God of his own sovereignty and love has simply made another exception to the rule. He said of the little ones that such are of the kingdom of God (Matthew 18:3-4). So the very young who die will be admitted immediately.
It is a puzzle the way your question is phrased. However, God is personal, not a set of rules, and has acted in love and mercy in this matter. Babies do go to heaven.
We have assurance of this because of 2 Samuel 12:22-23. There, King David tells his household about his dead infant, “But now he is dead …. Can I bring him back again? I shall go to him, but he shall not return to me.” King David was a saved man who loved the Lord very much. He had every expectation of entering the kingdom of heaven. He did not expect his child to come back to life, but he did expect to die and see his child in the kingdom.
What Do You Think?
a. Is God just to make exceptions and conditions? Why or why not?
b. If he saved everyone, would that mean we had no free will?