There's memorising and there's memorising.
My history lessons at school were entirely "here's 30 dates of these important events happening, there will be a test at the end of the month where you have to name the event at each of the given dates". I just remember sitting there trying to somehow remember what happened on each of those random dates, what event was it that I knew nothing about with zero context other than the fact that it happened. I can confidently say that after I ended my formal education I remember 0 of any of those dates. That approach to teaching history is just completely wrong, I would have loved to be told WHY certain things happened not just when they happened, but the system wasn't designed for it.
But maths formulas or even chemistry and physics - yes, that makes a lot of sense because you need to remember them and then you can actually use them to solve problems later.
Yep. Even for maths, knowing why is king. Once you understand maths there is a whole bunch that makes sense and you can just derive.