Our Gemara on Amud Beis discusses the levels of prophecy that occurred at the splitting of the Red Sea and how the Jews and Moshe responded via the prophetic singing of Az Yashir:

תָּנוּ רַבָּנַן דָּרַשׁ רַבִּי יוֹסֵי הַגְּלִילִי בְּשָׁעָה שֶׁעָלוּ יִשְׂרָאֵל מִן הַיָּם נָתְנוּ עֵינֵיהֶם לוֹמַר שִׁירָה וְכֵיצַד אָמְרוּ שִׁירָה עוֹלָל מוּטָּל עַל בִּרְכֵּי אִמּוֹ וְתִינוֹק יוֹנֵק מִשְּׁדֵי אִמּוֹ כֵּיוָן שֶׁרָאוּ אֶת הַשְּׁכִינָה עוֹלָל הִגְבִּיהַּ צַוָּארוֹ וְתִינוֹק שָׁמַט דַּד מִפִּיו וְאָמְרוּ זֶה אֵלִי וְאַנְוֵהוּ שֶׁנֶּאֱמַר מִפִּי עוֹלְלִים וְיֹנְקִים יִסַּדְתָּ עֹז

The Sages taught in a baraita that Rabbi Yosei HaGelili taught: At the time that the Jewish people ascended from the sea they resolved to sing a song of gratitude to God. And how did they recite this song? If a baby was lying on his mother’s lap or an infant was nursing from his mother’s breasts, once they saw the Divine Presence, the baby straightened his neck and the infant dropped the breast from his mouth, and they recited: “This is my God and I will glorify Him” (Exodus 15:2). As it is stated: “Out of the mouths of babies and sucklings You have founded strength” (Psalms 8:3).

The Maharal (Gevuros Hashem 5:47) makes a number of important observations in order to understand this piece of Aggadah. The idea of saying “Shirah”, spontaneous songs of praise to God, is the soul’s deep recognition and return back to God in a state of yearning and longing for attachment. A Shirah is an eruption of the created being, recognizing its Creator and gravitating in a spiritually instinctive manner to return back to its roots. Think of it like a drop of water that gravitates back to the ocean and clings to it to become one with it. This is the true meaning of the aggadic statements  that the nursing babies, and even the fetuses, saw God and joined in the Shirah. Maharal says it doesn’t literally mean that suckling infants and fetuses sang to God along with the Jewish people. It means that deep in their souls, they perceived it, and were aroused by God’s presence, and sought to become attached.

Aside from this being a most beautiful and deeply insightful representation of the human spiritual longing, we also see once again that we do not need to take certain aggados literally when they don’t make a lot of sense. Even if it were a historical fact, that these fetuses and suckling babies miraculously broke out into song, it’s kind of empty of real meaning. It’s just describing a powerful miracle. You could argue, there were so many other powerful miracles at the Red Sea. This is just one more effect. However, to me, it seems like miracle overkill. What use is it for babies to prophecy and erupt into song? And how would they be normal after that anyhow? Or even if you were to argue that based on Niddah (30b-31a) every fetus learns the entire Torah while it is in utero and then forgets it, obviously, this was something greater than that. How would those suckling babies be able to develop normally after being exposed to such an intense, emotional, spiritual and intellectual experience? This is why, according to the Maharal, it is not literal, and it is a metaphor for a deep, rejoicing and expression of attachment that comes from an arousal of spiritual instincts.