I suspect some of it is down to recognising positions, which will only come with time. As a simple example, do you even think about where the pieces go at the start of the game? Of course not, but at some point in the distant past you did. What about the Ruy after White's third move? Petroff after 2 moves? You get the idea. That databank of 'known' or familiar positions is bound to grow over time.
Secondly, it may have to do with visualisation skills. I posted some exercises on my site recently: http://becomingachessmaster.com/2015/04/25/how-to-improve-your-chess-visualisation-skills/
Strangely I have problems remembering positions. If someone would remove all pieces from the board during a blitz game of me, I couldn't place all of them correctly in most cases.
I do not have that problem with remembering lines so in the given example, it is more likely that I could reconstruct the game move for move out of memory than remembering the current position.
This probably slows me down when calculating, because I normally have to go back to the position on the board after every line, and if my visualization isn't on point maybe even multiple times per variation.
My plan is to practice this by setting up positions, looking at them for a while, removing the pieces, maybe doing some moves in my mind, and then setting up the pieces again.
Do you have any tips or methods to memorize a position accurately and quickly?