Dreams can be relived experiences.
In The Body Keeps the Score, Bessel van der Kolk dedicates a chapter to resolution of trauma using improvisational theater to relive from a position of control.
Our brains don’t understand the difference between the dream and the lived experience, because the brain “lives” it in a dream. When the dream resolves the trauma to its satisfaction, the memory of the traumatic experience are detached from the negative emotions.