This is clearly taught in scripture. The argument that first one needs to believe in Christ before baptism and thus children cant believe till they grow up is quite shocking coming from people who claim sola scripture. Jesus teaches that disbelief in Him at a young age can only be caused by an adult corrupting the child:
Then said he unto the disciples, It is impossible but that offences will come: but woe unto him, through whom they come!
It would be better for them to be thrown into the sea with a millstone tied around their neck than to cause one of these little ones to stumble. (LUKE 17.1-2)
Children are naturally inclined to believe in Jesus Just as John the Baptist leaped in the womb when Mary with child greeted her kin Elizabeth. Listen to what holy scripture says
And whosoever shall offend one of these little ones that believe in me, it is better for him that a millstone were hanged about his neck, and he were cast into the sea.(Mark 9.42)
And whoso shall receive one such little child in my name receiveth me.
But whoso shall offend one of these little ones which believe in me, it were better for him that a millstone were hanged about his neck, and that he were drowned in the depth of the sea. (Matthew 18.5-6)
And when the chief priests and scribes saw the wonderful things that he did, and the children crying in the temple, and saying, Hosanna to the Son of David; they were sorely displeased,
And said unto him, Hearest thou what these say? And Jesus saith unto them, Yea; have ye never read, Out of the mouth of babes and sucklings thou hast perfected praise? (Matthew 21.15-16)
No child is condemned, but what has not been revealed is the nature of their treasures. Are infants who die still babies in heaven? If so, a baby is happy with resting and being fed, Christ was laid in a manger, the baby of a rich prince may lay in a golden crib but neither condition does a baby realize. If the infant is found in adult form in heaven what level of education? What life experiences does he have? What if any virtues has the babe cultivated? How can the parable of the talents in Matt 25.29 be applied to an infant who had no chance to cultivate virtues in this life? These are the questions St. Gregory of Nyssa tried to answer in his treatise Infants early death, probably not to a satisfactory level. Of course there are non-doctrinal theories and traditions, i believe a popular one is babies are under the auspices of care-taking angels, etc.