What happens to children when they die?
The Bible states that children go to heaven when they die. Take a look at this example:
"So Nathan went to his house. Then the LORD struck the child that Uriah's widow bore to David, so that he was very sick. David therefore inquired of God for the child; and David fasted and went and lay all night on the ground. The elders of his household stood beside him in order to raise him up from the ground, but he was unwilling and would not eat food with them. Then it happened on the seventh day that the child died. And the servants of David were afraid to tell him that the child was dead, for they said, "Behold, while the child was still alive, we spoke to him and he did not listen to our voice. How then can we tell him that the child is dead, since he might do himself harm!" But when David saw that his servants were whispering together, David perceived that the child was dead; so David said to his servants, "Is the child dead?" And they said, "He is dead." So David arose from the ground, washed, anointed himself, and changed his clothes; and he came into the house of the LORD and worshiped. Then he came to his own house, and when he requested, they set food before him and he ate. Then his servants said to him, "What is this thing that you have done? While the child was alive, you fasted and wept; but when the child died, you arose and ate food." He said, "While the child was still alive, I fasted and wept; for I said, 'Who knows, the LORD may be gracious to me, that the child may live.' "But now he has died; why should I fast? Can I bring him back again? I will go to him, but he will not return to me."" (II Samuel 12:15-23).
Take careful note that once the child died, David stopped weeping. The child was beyond David's reach, but David looked forward to joining his son after death. David knew the child was with God. The significance of this event is even stronger when you see David's reaction to the death of his son, Absalom (II Samuel 18:33; 19:4). David had no such hope for Absalom.
The reason is simple. It has only been made muddied by those who claim that sin is inherited from Adam. If you realize that sin is not inherited, then the answer is clear. "The soul who sins shall die. The son shall not bear the guilt of the father, nor the father bear the guilt of the son. The righteousness of the righteous shall be upon himself, and the wickedness of the wicked shall be upon himself" (Ezekiel 18:20). John tells us that sin is the breaking of God's law (I John 3:4). Infants have no opportunity to break God's law. Even children are safe, not because they don't break laws, but because there is an age where they do not have the knowledge of good and evil (like Adam and Eve before they ate of the forbidden fruit). "Moreover your little ones and your children, who you say will be victims, who today have no knowledge of good and evil, they shall go in there; to them I will give it, and they shall possess it" (Deuteronomy 1:39). While they are without the knowledge of good and evil, they are not held accountable for sins.
See "Is Sin Inherited from Adam?" for more details.