I went to a Saturday school for many of my childhood years, as my dad wanted me to learn Arabic. They were bad at teaching the language, but did get us to read the script and memorise several Quran verses. You were supposed to get "rewards" in heaven just for memorising without understanding. To this day I can recite Al-Fatiha [0] despite not understanding a word, being an atheist, and not having prayed for maybe 15 years.
Same, as a kid there were a whole bunch of bible verses to memorize, which was required. To this day I can recite quite a few of them, and (despite now being an atheist) I still occasionally have some of them pop into my head in situations where it might be relevant. Memorization is an extremely powerful tool, and particularly religions have known and used this for millenia.
The difference between your experience and mine is that I have no idea what the verses are saying! They almost never pop into my head because I can't relate them to situations.
[0] https://myislam.org/surah-fatiha/