Don't forget 'analytic' memory: knowing in detail how the composition is constructed (take for instance the right hand figure of Vierne's final symf.V - not much to 'understand', yet a lot of notes) , and 'absolute' memory: knowing every little detail as an absolute fact (my teacher in Cologne used to try me on that: which note is written in the alto on the third quarter in measure x, mein Herr?).
Also, learning a very (very) difficult piece by heart may be easier to play than playing it from score; once it's in memory, one can focus on the music (if you're relaxed enough that the piece is in your memory (which it is, just take care to 'get it back').
But one can sometimes be jealous on those pianists who learn a Rach.3 in a week ...