There are many techniques to memorizing pieces. I don't have much of a problem at all memorizing pieces regardless of length, but my downfall is that I'm not a good reader, so I rely on my ear and my ability to memorize quickly. I'd rather be a good reader than a good memorizer.
There are three parts to memorization that are independent of each-other but also rely heavily on one another.
Muscle Memory
Aural Memory
and Theoretical Memory/Knowledge
Muscle Memory has to do with having the music "in the hands." Have you ever noticed that even if you haven't played a piece in ages, if you don't concentrate on the notes too much, your hands can find their way to the general area of the right notes? That's where muscle memory comes in. Your hands remember the motions, but not consciously.
Aural Memory is your memory of how the piece sounds. This can lead your hands to the right pitches should your muscle memory not be exact.
Last, but not least, is Theoretical Memory and Knowledge, and I don't know many people who rely too heavily on this when memorizing, though it is very useful to put into use should you have a memory slip. This pertains to Music Theory and Harmonic Rhythm. If you know the progression of the chords, you know generally where you "should" go in the piece, however this is more often replaced with Aural Memory. The benefit of having this knowledge of harmonic rhythm is that if you lose concentration and you know where you are harmonically, you can improvise around the chord structure to buy you a little bit of time to get where you need to be, or even just jump to the next chord. Again, this can be replaced by creating "checkpoints" in the music that you can jump to should a catastrophe occur.
Much of the time, this is all done subconsciously. If you practice a piece enough, it will become ingrained into your ears and your hands. For me, this comes naturally, but others have to work at it section by section implementing each of the above parts of memory.
I'm sure there's more to it than what I just said, but from what little experience I have, it seems to make a bit of sense...to me at least.