The definition of dissociation in psychology is given in Google Dictionary as:
[the] separation of normally related mental processes, resulting in one group functioning independently from the rest, leading in extreme cases to disorders such as multiple personality
Let's put this into plain English.
According to the American Psychological Association's DSM-5 (Diagnostic and Statistical Manual, 5th Ed.; APA, 2013), dissociation is:
a disruption of and/or discontinuity in the normal integration of consciousness, memory, identity, emotion, perception, body representation, motor control, and behavior (p. 291).
The APA's Dictionary of Psychology further clarifies this with (emphasis mine):
a defense mechanism in which conflicting impulses are kept apart or threatening ideas and feelings are separated from the rest of the psyche. See compartmentalization.
Basically, when you are dissociating, you are "disconnecting yourself" from what is going on around you during a period of time. The period of time can be seconds, to minutes, and maybe hours over a number of days or longer.
This can happen with or without trauma. For example, there can be dissociation experienced via "dissociatives" (dissociative anaesthetics such as Ketamine or Nitrous Oxide).
Dissociation can also be a way the mind copes with too much stress (NHS n.d.), and dissociative disorders are mental health problems which can develop as a result of these episodes of dissociation. Dissociative Amnesia is one of them.
The NHS states that:
Some people with dissociative amnesia find themselves in a strange place without knowing how they got there (NHS n.d.).
That is because maybe, a PTSD sufferer let's say, might start to dissociate when they are in an area which a traumatic event occurred. Combat veterans may become startled by a car backfiring, which then leads to sudden panic and forgetting how, or why, they got to that place.
They may have travelled there on purpose, or wandered in a confused state.
These blank episodes may last minutes, hours or days. In rare cases, they can last months or years.
Memories can be "fractured" during dissociative episodes and all memories are plastic (see my answer to Can people improve their memory by training themselves to recall previously forgotten memories? and my answer to PTSD based on false memories.
There can be gaps in the memories of what happened during traumatic times due to dissociation. The disconnection from what is going on around you can take many forms. You could be just taking yourself, in a dream-like state, to a totally different place where you feel safer to block out what is actually happening. There can be brief moments where this doesn't work due to extreme pain for example, although in some situations extreme pain can even be blocked.
Some who dissociated during trauma have reported that they just "disconnected from their body" (out-of-body or near death experiences) and it was like they were seeing things happen to themselves, but like in the third-person. Like they were watching a fictional drama of themselves going through the event.
This can lead to that person questioning whether what they saw actually did happen, and they can also not remember what was blocked with the dissociation, hence, dissociative amnesia.
If you are mentally strong enough to watch it, a good example of dissociation was demonstrated in the fictional TV series Outlander, in Season 5 Episode 12 — Never My Love (Starz, 2020). In the season, the protagonist (Claire), originally from the 1960s is experiencing America from 1770 to 1772 and in this episode, she suffers the ordeal of multiple rapes.
During the rapes, she dissociates and in her mind, close friends and family are with her in the 60s, but little bits of information about what is happening gets through in drips in a disorientating fashion. More can be read about this episode at https://www.outlandertvnews.com/2020/05/outlander-review-episode-512-never-my-love-season-finale/ and https://www.vulture.com/2020/05/outlander-season-5-finale-recap-episode-12-never-my-love.html
APA. (2013). Diagnostic and statistical manual of mental disorders (DSM-5®). American Psychiatric Pub. https://www.psychiatry.org/psychiatrists/practice/dsm
NHS. (n.d.). Dissociative Disorders https://www.nhs.uk/mental-health/conditions/dissociative-disorders/