I don't think I really understood anything in school, but I was decent at going through the motions of carrying out certain methods and recalling certain facts when I needed to.
I went on to study Maths at university, and for most of my first year, I had the same surface level "methods + facts" knowledge that got me through school. After some studying, I could recite definitions and theorems, I'd memorised some proofs, and I could occasionally manipulate a problem to get an answer. I think about half of the cohort was in a similar position. But it was clear that there were others in a completely different league.
When we were studying for our first year exams, I was struggling to remember the proof of a specific theorem (it felt quite long). A friend was trying to help me learn it, and he asked me what "picture" I had in my head for the theorem. I didn't have any pictures in my head for anything.
It turned out that a simple drawing could capture the entire statement of the theorem, and from that drawing, the proof was trivial to derive. It was long-ish to write out in words, sure, but the underlying concept was really simple. This blew my mind — I realised I didn't have a clue what we'd been studying the whole year.
The worrying thing is that I actually thought I understood that stuff. Before that incident, I didn't know what it feels like to actually understand something, and I didn't have an appreciation for the layers of depth even within that. I suspect lots of people go through the entire education system like this.