Why do we remember so little before the age of three? Why do we remember where we were when the Princess of Wales died? Why do we forget people's names? Why do our lives pass before our eyes as we're dying? Why does time speed up as we get older?

Memory is like a dog that lies down where it pleases, said the Dutch writer Cees Nooteboom in Rituals. No matter how you wrestle with it, bump into someone in the street you're not expecting to and suddenly their name refuses to move from the tip of your tongue to your brain. Go into a supermarket and chances are that you'll leave having forgotten the one thing you went in for.

Memory is like a dog that lies down where it pleases, said the Dutch writer Cees Nooteboom in Rituals. No matter how you wrestle with it, bump into someone in the street you're not expecting to and suddenly their name refuses to move from the tip of your tongue to your brain. Go into a supermarket and chances are that you'll leave having forgotten the one thing you went in for.

Our memory can let us down at any age, but when we reach our forties it appears to get up to a whole new kind of mischief: the perception that life is suddenly speeding up. Annual rituals such as birthdays and Christmases appear to come round faster than ever, and summers are over before they have even started. "This is a powerful time illusion and most people experience it," says Douwe Draaisma, who explains the phenomenon in Why Life Speeds Up As You Get Older, published on 4 November. A professor of the history of psychology at the University of Groningen in the Netherlands, Draaisma says the first factor at play may well be what scientists refer to as the reminiscence effect. As people get older, their early memories from the ages of 15 and 25 become much more vivid than those of later years because they hold so many first-time experiences.

"When you get old you tend to remember fewer things, because there is a lot more repetition in your life and a lot of it is routine. You have a very good memory for first-time experiences, most of which happen when you are younger. We still have first-time memories when we are 50, of course, but they are not as frequent. But once repetition creeps in, as it does when you get older, it's very difficult for your mind to reproduce specific memories.

"It is a very powerful effect. Even Alzheimer's patients have a preference for memories from the time when they were 15 or 20. When you read autobiographies, the things that had consequences for people are mostly the things that happened when they were 20 or 25 years of age."

So naturally, as we get older, we tend to remember things that happened when we were younger. Added to that is the fact that time seems to expand with the number of memories it holds. For example, a week's holiday with lots of new experiences will appear to have lasted longer than a week spent on the usual office routine. Similarly, the outward journey on a trip seems to last longer than the return as fewer memories are made coming back because the route is now familiar.

"I would argue that the same holds true on a lifelong scale for youth memories," says Draaisma. "When these are vivid again in old age, it seems as if the time as a youth has lasted longer than, say, a year during middle age."

There may well also be physiological reasons at play. "There are all of kinds of biological clocks in the human body that play a part in indicating subjective time. Fever, for instance, makes you experience time faster, and cold makes you experience time slower, and when these physiological clocks start to slow down in old age it appears as if clock time seems to speed up."

Draaisma's book also examines the curious fact that we remember almost nothing before the age of three. The psychologist believes part of the explanation is to do with the maturing of the brain. Up until the age of three the brain is still changing rapidly, which makes it difficult to form memories. "Another explanation would be that part of the way our memory works is by telling ourselves stories and retelling them. After a very busy day you will sit quietly and think of the day and that's the way of telling yourself a story. But it depends on having language and when you are one, two or three you don't have a language in which you tell yourself a story of what happened to you. So it makes it very difficult to repeat your experiences [in your mind]. And perhaps once we are used to using language memory it's difficult to have access to earlier memories because they are outside the format of language, so to speak."

Memory has an important role to play in déjà vu, the sensation that you have lived a particular moment before. "Traditionally, there were a lot of explanations of earlier lives and former lives," says Draaisma. However, the psychologist believes in a more scientific explanation, as not everyone experiences déjà vu. "It could have to do with concentration," he suggests. "It may be that because of a lack of concentration, something that you experience comes in twice. At first, due to lack of concentration you don't notice something, and then when you raise your concentration you see exactly what happened. It is as if you are experiencing this faint echo of the earlier experience that is still there."

Draaisma also studies the research into why people's lives appear to flash before them during near-death experiences. "It may be that alterations to the brain, such as lack of oxygen, may cause some cells in the brain to fire more or less randomly.

"When they are from the area in the brain where you have stored your early memories, it may be that you begin to see all kinds of childhood memories that are very vivid."

Ask someone what they were doing, what they were wearing and what the weather was like on 3 May 2000, the odds are that they will have no idea. However, ask them the same questions about 31 August 31 1997 - the day on which they would have heard that Diana, Princess of Wales, had died - and they will probably give you a detailed description of the room they were standing in at the moment they heard. Memories of the report of a significant event, and also of the setting you were in when you heard, are known as "flashbulb memories". One hypothesis is that the sudden emotion causes a rush of adrenaline in the brain, which, for a short time, makes people notice things visually. Another is that flashbulb memories are often about things that people would like to share with others, and because they tell the story so often, the repetition commits it to memory.

"On the other hand," counters Draaisma. "There are a lot of flashback memories that are not that spectacular. For example, there are a lot of women who remember their first period, and even if they haven't told anyone about it, it's still a very vivid memory for them. So it can't be the full explanation. The strange thing is that you seem often to remember all kinds of irrelevant things: I remember exactly the colour of the pullover my daughter was wearing when she told us that Diana had died."

While we are able to linger on more pleasant memories, when it comes to traumatic ones, we have no control over them popping into our heads. "You are not the boss of your memories," says Draaisma. "It is not a book that you can edit. If you could you might leave out the unpleasant memories and then elaborate on the happy memories, but then you would have a memory that wasn't of much use in daily life and one that would get you into trouble because it's precisely the painful, traumatic and dangerous things that you remember very vividly, so there may be an evolutionary background to this phenomenon."

The psychologist says we are not able to improve our personal memories (though there are tricks to remember what is often useless information). Those who have good memories were simply born that way. And while scientists have yet to find out why the pint of milk we expressly went to the supermarket for gets forgotten, he says there is no point repeating the word "milk" in your head on the journey there. Telling yourself not to forget something, he says, is often a recipe for disaster. And, crucially, Draaisma added that... er... oo... no, sorry, it's gone.

'Why Life Speeds Up As You Get Older: How Memory Shapes our Past' by Douwe Draaisma is published by Cambridge University Press, £19.99