The average person seems to have a remarkable memory for tempo. In an experiment that Perry Cook and I published in 1996, we asked people to simply sing their favourite rock and popular songs from memory and we were interested to know how close they came to the actual tempo of the recorded versions of those songs.
As a baseline, we considered how much variation in tempo the average person can detect: that turns out to be 4 percent. In other words, for a song with a tempo of 100 bpm, if the tempo varies between 96 - 100, most people, even some profesisonal musicians, won't detect this small change (although most drummers would – their job requires that they be more sensitive to tempo than other musicians, because they are responsible for maintaining tempo when there is no conductor to do it for them).
A majority of people in our study – non-musicians – were able to sing songs within 4 percent of their nominal tempo. The neural basis for this striking accuracy is probably in the cerebellum, which is believed to contain a system of timekeepers for our daily lives and to synchronize to the music we are hearing.
This means that somehow the cerebellum is able to remember the "settings" it uses for synchronizing to music as we hear it, and it can recall those settings when we want to sing a song from memory. It allows us to synchronize our singing with a memory of the last time we sang.