As pointed out above, we owe the requirement for memorization when performing in public to Liszt. It's unfair, because chamber musicians, for example, are allowed to have their music. Where is the justice in the world!
Anyway, that being what it is, there are four factors that facilitate memory. The first is tactile memory as referred to above by Willcowskitz. The important thing to remember is that you must always use at least TWO of the four methods in tandem, NEVER ONE. Countless pianists have foundered when they relied solely on tactile memory and it evaporated during performance. It's the most treacherous method!
The next kind is aural memory. I like to call that the "mind's ear". It's knowing the sound and flow of the piece not only from the beginning, but from any "landmark" point within the music.
The third aid is visual memory--this is literally the photographic memory where one can close eyes and actually see the details of the score. How can anyone get lost with that talent? But only a tiny fraction of the population enjoys that ability, so it is of the least importance overall.
The final kind is analytical memory. This comes from thorough study of the piece away from the keyboard. Analysis is done on form, modulations, cadences, voice leading, climaxes, inner lines, etc. such that the pianist knows and can recall the major sequential structural elements of the piece and can "bookmark" important landmarks in his/her mind as aids in performance. Again, the thing to remember is that the pianist must always rely on at least two, never one approach. Geiseking was a master at this method.
Not all artists have had great memories. Greats like Cortot and d'Albert used to have memory lapses frequently. With Eugene d'Albert, people used to flock to his performances, because he was an extraordinary improviser--one of the best ever. So when he would become lost, he would instantly improvise until he could find his way back and reconnect with the composer. The audience would be enthralled at the beauty he would elicit from the piano during those impromtu transitions. In fact they thought his "wrong notes" were worth more than the cost of their tickets. Unfortunately, the recording industry has made today's audiences far less generous in their assessments of performing artists.