Does it ever strike you as odd that you and a friend can experience the same event at the same time, but come away with different memories of what happened? So why is it that people can recall the same thing so differently?

We all know memory isn’t perfect, and most memory differences are relatively trivial. But sometimes they can have serious consequences.

Imagine if you both witnessed a crime. What factors lead to memory differences and whom should we trust?

Read more: You can't 'erase' bad memories, but you can learn ways to cope with them

There are three important aspects to memory: encoding, storage, and retrieval.

encoding is how we get information into the brain

storage is how we retain information over time

retrieval is how we get information out of the brain.

Differences in each or a combination of these aspects might help explain why memories differ from one person to another.

How different people encode memories

Memory encoding starts with perception — the organisation and interpretation of sensory information from the environment.

The salience of sensory information (for example, how bright a light is or loud a sound) is important – but perception does not rely on salience alone.

Rather, perception is strongly affected by what we have experienced in the past and our expectations of what we might experience in the future. These effects are called top-down processes, and have a big impact on whether we successfully encode a memory.

One of the most important top-down processes is attention — our ability to focus selectively on parts of the world, to the exclusion of other parts.

While certain visual items can be perceived or encoded into memory with little or possibly no attention, attending to items is hugely beneficial for perception and memory.

How different people focus their attention on an event will affect what they remember.

For example, your preference for a particular sporting team can bias your attention and memory. A study of American football found that sports fans tended to remember rough play instigated by their opponent, rather than their own side.

Age also contributes to differences in memory, because our ability to encode the context of memories diminishes as we get older.

Context is an important feature of memory. Studies show that if we attend to both an item and its context, we remember the item better than if we attend to the item alone.

For example, we are more inclined to encode the location of our car keys if we focus on both the keys and how we have placed them in a room, rather than just focusing on the keys alone.

How different people store memories

Memories are first encoded into a temporary memory store called short-term memory. Short-term memories decay quickly and only have a capacity of three or four bits at a time.

But we can group larger bits of information into manageable chunks to fit into memory. For instance, consider the challenging letter sequence:

C, I, A, A, B, C, F, B, I

This can be chunked into the easily memorised:

CIA, ABC, FBI

Information in short-term memory is held in a highly accessible state so we can bind features together. Techniques such as verbal rehearsal (repeating words aloud or in our head) allow us to consolidate our short-term memories into long-term memories.

Long-term memory has an enormous capacity. We can remember at least 10,000 pictures, according to a study from the 1970s.

Memories can differ between people on the basis of how we consolidate them. Many studies have investigated how memory consolidation can be improved. Sleep is a well-known example.

A study found that long-term memory can also be enhanced by taking caffeine immediately after learning. The study used caffeine tablets to carefully control dosage, but this builds on growing evidence for the benefits of moderate coffee consumption.

How different people retrieve memories

Retrieving episodic memories, our memory of events, is a complex process because we must combine objects, places and people into a single meaningful event.

The complexity of memory retrieval is exemplified by tip-of-the-tongue states — the common and frustrating experience that we hold something in long-term memory but we cannot retrieve it right now.

The emergence of brain imaging has meant we have identified many brain areas that are important for memory retrieval, but the full picture of how retrieval works remains mysterious.

There are many reasons that memory retrieval can differ from one person to another. Our ability to retrieve memories can be affected by our health.

For example, memory retrieval is impaired if we have a headache or are stressed.

Retrieval is also affected by the outside world; even the wording of questions can change how we recall an event. A study instructed people to view films of car accidents and then asked them to judge the speed the cars were moving. If people were asked how fast the cars were moving when they “crashed” or “smashed” into each other they judged the cars as moving faster than if the words “contacted” or “hit” were used.

Memory retrieval can also be affected by the presence of other people. When groups of people work together they often experience collaborative inhibition — a deficit in overall memory performance when compared to the same group if they work separately and their memories are pooled after each individual has recounted their version.

Read more: It's not so easy to gain the true measure of things

Effects such as collaborative inhibition highlight why memory differences occur but also why eyewitness testimony is so problematic.

Thankfully, the proliferation of smartphones has lead to the development of innovative apps, such as iWitnessed, that are designed to help witnesses and victims preserve and protect their memories.

Technology such as this and knowledge of memory encoding, storage, and retrieval can help us determine whom to trust when differences in memory occur.