In Parshat Vayelech, the Torah commands us to fulfill the Mitzvah of Hakhel. The Torah says that we, the Jewish nation, must gather together at the Beit Hamikdash on Succot of the Shmitah year and listen to the Jewish king read certain sections of Sefer Devarim that relate to Hashem's covenant with us. (This is only required when the Beit Hamikdash is in existence.) Upon close examination, one would find that even children are included in this Mitzvah. Devarim 31:12 states, “Gather together the people - the men, the women, and the small children, and your stranger who is in your cities - so that they will hear and so that they will learn…”. Upon closer examination, the Ramban notes that Chazal believe that even an infant is obligated in this Mitzvah. The very next verse says, “…And the children who do not know - they shall hear and they shall learn to fear Hashem…”.
One could ask, “Why are children and babies obligated in this Mitzvah?” Rashi explains that it is in order “to give reward to those who bring them.” When parents bring a child to Hakhel, they hope their child will learn from it. This shows that the values of Torah knowledge are important to the parents of this child and thus they should be rewarded.
Now we must understand how an infant could possibly gain from an experience such as Hakhel. The Torah specifically identifies infants as “the children who do not know,” meaning that they do not comprehend most of what goes on around them. Babies do not learn as children do. As long as a baby is being held, is not tired, and is fed, it makes no difference to him whether he is at Hakhel or at home!
The Sfat Emet says that even though a baby may not consciously be aware of what Hakhel is, it will still make an impact on his Neshama. The Sfat Emet goes on to explain that when this infant grows up, he will have a greater appreciation for Torah knowledge when he remembers that his parents carried him all the way to the Beit Hamikdash to hear Hakhel.
We can see a combination of all three answers to our question in a story from the Talmud. The Talmud tells us that a mother would bring her baby to the Beit Midrash so that he could absorb the sounds of the Rabbis' Torah study. This baby would later become one of the Rabbis in the Mishnah. Rashi says that the mother has demonstrated that the value of Torah knowledge is important to her, and she is therefore deserving of reward. Also, the Sfat Emet explains that the baby may not comprehend what he is hearing but it will have made an impact on his Neshama while instilling an appreciation of Torah knowledge in him due to his mother's many trips to the Beit Midrash.