Do you know about church schools? Same concept.
The Madarsa students memorize Quran, learn its meaning, learn how to pray, etc.
In Christian terms, it is like the training of a Priest:
The seminarian stage requires four years of study in theology at a seminary. After graduation from the seminary, the priest serves for roughly one year as a transitional deacon. It typically takes five years from college graduation to ordainment, provided the priest has studied philosophy at the undergraduate level.
And by the way, they are registered, and they get degrees after exams. The process is streamlined. Ghost madrasas or unregistered ones don't exist anymore (Tejas and his fear-mongering).