For most of its running time the film seems to be a simple miracle: Soo-ah comes back with the rain, falls in love with Woo-jin again, teaches Ji-ho how to manage without her, and disappears when the rainy season ends.
The final act, told through Soo-ah's journal, reveals the mechanism. Years earlier, as a young woman, Soo-ah had an accident. While she was unconscious, she found herself in the future with a husband and son she had not yet met. When she woke up, she knew that marrying Woo-jin would lead to her early death. She chose him anyway. In her own words, she survived the accident "because you and Ji-Ho were desperately waiting for me in the future."
This changes how the whole film reads. The "ghost" wife was really the younger Soo-ah visiting from the past, and her return was not a haunting but the start of their love. Every earlier romantic moment becomes a moment she consciously chose, and the tragedy becomes an affirmation of love.