Dreaming is mainly caused by three aspects: overthinking and thinking during the day; Some images in daily life can be presented in dreams; Subconscious dreaming becomes an unconscious activity. And your dreams belong to the first and the third.
Dreams can't predict anything.
From a scientific point of view, dreams are just reflections of deeper things you see or think of. When we go to sleep, although the brain is at rest, some parts (areas where we use more) will still be active, and what we think corresponding to the active parts will appear in our dreams, which is why people say that they think during the day and dream at night.