Your subconscious mind may use dreams about your ex to help you process what occurred or give you closure.
When you're feeling down and out about your present situation, your thoughts may go back to better moments, some of which may include your ex.
The dream might be your mind's method of bringing up your feelings of loss and inadequacy.
If your emotional connection with your ex was exceptionally deep, the neurotransmitters linked with love and bonding may continue to influence your dreams.
Ex-love interests often pop up in our dreams. They don't always indicate that you're not over someone or that you want to get back together.
Unresolved feelings, nostalgia, anxiety, and even physiological processes in the brain may all play a role.