Do babies and others incapable of understanding (mentally retarded) and thus incapable of professing faith in Christ automatically go to heaven?
The following verses will give you a good idea of how to view this:
2 Samuel 12:20-23 Then David arose from the earth, and washed, and anointed himself, and changed his apparel, and came into the house of the LORD, and worshipped: then he came to his own house; and when he required, they set bread before him, and he did eat. Then said his servants unto him, What thing is this that thou hast done? thou didst fast and weep for the child, while it was alive; but when the child was dead, thou didst rise and eat bread. And he said, While the child was yet alive, I fasted and wept: for I said, Who can tell whether GOD will be gracious to me, that the child may live? But now he is dead, wherefore should I fast? can I bring him back again? I shall go to him, but he shall not return to me.
Better off miscarried (still-born) where there is freedom from trouble and the weary be at rest:
Job 3:1-17 After this opened Job his mouth, and cursed his day. And Job spake, and said, Let the day perish wherein I was born, and the night in which it was said, There is a man child conceived. Let that day be darkness; let not God regard it from above, neither let the light shine upon it. Let darkness and the shadow of death stain it; let a cloud dwell upon it;let the blackness of the day terrify it. As for that night, let darkness seize upon it; let it not be joined unto the days of the year, let it not come into the number of the months. Lo, let that night be solitary, let no joyful voice come therein. Let them curse it that curse the day, who are ready to raise up their mourning. Let the stars of the twilight thereof be dark; let it look for light, but have none; neither let it see the dawning of the day: Because it shut not up the doors of my mother’s womb, nor hid sorrow from mine eyes. Why died I not from the womb? why did I not give up the ghost when I came out of the belly? Why did the knees prevent me? or why the breasts that I should suck?For now should I have lain still and been quiet, I should have slept: then had I been at rest, With kings and counsellers of the earth, which built desolate places for themselves; Or with princes that had gold, who filled their houses with silver: Or as an hidden untimely birth I had not been; as infants which never saw light. There the wicked cease from troubling; and there the weary be at rest.
Being still born is preferable to a life of wickedness (and not a life filled with good):
Ecclesiastes 6:3-6 If a man beget an hundred children, and live many years, so that the days of his years be many, and his soul be not filled with good, and also that he have no burial; I say, that an untimely birth is better than he. For he cometh in with vanity, and departeth in darkness, and his name shall be covered with darkness. Moreover he hath not seen the sun, nor known any thing: this hath more rest than the other. Yea, though he live a thousand years twice told, yet hath he seen no good: do not all go to one place?
Deuteronomy 1:39 Moreover your little ones, which ye said should be a prey, and your children, which in that day had no knowledge between good and evil, they shall go in thither, and unto them will I give it, and they shall possess it.
Isaiah 7:16 For before the child shall know to refuse the evil, and choose the good, the land that thou abhorrest shall be forsaken of both her kings.
God knows when a person comes to the age of accountability. But Infants who have no knowledge between good and evil and having the ability to refuse the evil and chose the good are protected by God’s providence because they have not committed those deeds or acts of sin where they would be held accountable. Those of accountability age are saved by grace through faith and not of works. Damnation to hell is by (unrepentant) evil deeds committed by the accountable.
Romans 2:6 Who will render to every man according to his deeds:
2 Corinthians 5:10 For we must all appear before the judgment seat of Christ; that every one may receive the things done in his body, according to that he hath done, whether it be good or bad.
Revelation 20:12-13 And I saw the dead, small and great, stand before God; and the books were opened: and another book was opened, which is the book of life: and the dead were judged out of those things which were written in the books, according to their works. And the sea gave up the dead which were in it; and death and hell delivered up the dead which were in them: and they were judged every man according to their works.
Revelation 22:12 And,behold, I come quickly; and my reward is with me, to give every man according as his work shall be.
Ephesians 2:8-10 For by grace are ye saved through faith; and that not of yourselves: it is the gift of God: Not of works, lest any man should boast. For we are his workmanship, created in Christ Jesus unto good works, which God hath before ordained that we should walk in them.
Let’s also not forget that God is the Perfect Judge and will send everyone where they belong (heaven or hell).