Devarim / Deuteronomy 31:12 · Pshat
הַקְהֵל אֶת־הָעָם הָאֲנָשִׁים וְהַנָּשִׁים וְהַטַּף וְגֵרְךָ אֲשֶׁר בִּשְׁעָרֶיךָ לְמַעַן יִשְׁמְעוּ וּלְמַעַן יִלְמְדוּ וְיָרְאוּ אֶת־יְהוָה אֱלֹהֵיכֶם וְשָׁמְרוּ לַעֲשׂוֹת אֶת־כָּל־דִּבְרֵי הַתּוֹרָה הַזֹּאת׃
Assemble the people, the men and the women and the little ones, and the stranger who is within your gates, so that they may hear and so that they may learn, and fear the Eternal your Almighty, and take care to do all the words of this Torah.
Pshat פְּשָׁט
Why carry the infants
Once in seven years, on Sukkot after the shmita year, the whole people gathered to hear the Torah. Everyone was called: men, women and even infants who will understand nothing. The commentators ask who comes for what.
Rashi: the men come to learn, the women to hear, and the children to give reward to those who bring them. Ramban: "so that they may hear and so that they may learn" is said of both men and women, for women too hear and learn to fear the Eternal. Chizkuni: after the shmita year everyone is free, the crop belongs to no one, and nobody needs to gather it in.
How Rashi, Ramban, and Chizkuni explain it
Rashi The men
To learn.
Rashi And the women
To hear.
Rashi And the little ones
Why do they come? To give reward to those who bring them.
Ramban So that they may hear and so that they may learn
The men and the women, for the women too hear and learn to fear the Eternal.
Chizkuni Assemble the people
For everyone is free and gathers nothing into the house, because everything is ownerless.
Takeaway
The assembly of the whole people (Hakhel) took place on the festival of Sukkot right after the shmita year (verses 31:10–11). In the shmita year the land is not worked and the crop belongs to all.
Rashi divides the roles: the men learn, the women hear. Ramban reads the verse differently: the words "so that they may hear and so that they may learn" refer to both.
Onkelos renders "and the little ones" (וְהַטַּף) as "and the small children" (וְטַפְלָא): these are very young children who are carried in arms.