Grounding is a common method of dealing with anxiety and other mental health issues. The idea of finding your place, finding familiarity, centring yourself. Something you are very used to doing normally and when safe is important, as is having that also associated very strongly with being safe.
For some people, photos will work well for this - they might capture moments with strong association with safety and happiness. Some people may be able to instead use an object, a talisman of sorts.
For others, or for when the disassociation is worse, a single grounding method may not be enough. It's about building the complete story - getting home and watching something familiar. The grounding only happens from weight of evidence.
Finally, there's something you don't hear talked about much. Coming back around from disassociating can be utterly terrifying in it's own right. Both as one tries to return, and after coming back. Having multiple entirely different means to ground helps with this.
What's hard for me to imagine is how this disorder works physically, at least with the primitive model I have on how the brain works. The synaptical connection are still there, otherwise the person would have a permanent memory loss, right? So my guess is it has to do with brain chemistry? If that's the case, couldn't it be medicated?
You can use drugs to help with the symptoms, but you can't "fix" it with drugs. There's nothing physically wrong with a DID patient (although they do tend to suffer from various "side effects" that are linked with the disorder).
As far as how it works physically, we don't know for sure. Yes, the memories are stored and can later be accessed. Part of the problem is that these memories are stored without being processed or are "stored" with a part that is unable to make sense of what happened. So instead of dealing with what happened the patient relives the trauma over and over again. What's interesting is that one part can "share" a memory with another part. When this happens it's like "remembering" something you've never experienced.
My wife has these episodes. Evidence-based and logic-based approaches are very ineffective. If I can convince her to go for a ride in the car, and we drive around the city she has lived in her entire life, and drive by the house she grew up in, schools she went to, and get some food from a drive through she's been to hundreds of times, it will reduce her time-to-return by 24-48 hours usually. We can look through several thick photo albums, and at the end she just shrugs and says, "I don't know who any of these people are".
Depends who they are and how and what they forget.