Dreaming about an ex, to me, is like seeing a relative in your dreams whom you haven't encountered in ages. They are remnants in your mind and your brain is just sifting through stuff.
I once saw a cousin in my dream. In this dream, my cousin is the age that she would've been had she not passed away as a toddler.