A lot of learning takes place in school, but not much of it is academic. Students learn passivity, anxiety, groupthink, meaningless competition, malice, treachery, cruelty, frustration, and sometimes hopelessness. And public schools teach these things very well.
Yes, you are right. A lot of learning does take place in school. Children learn how to be good prisoners. As adults they will be comfortable as prisoners of the state.