The reason why ADULTS have nightmares/bad dreams is caused by medications/and or illnesses, stress/and or anxiety, stressful/and or frightening events that have happened in your life.
But, children experience more nightmares than adults can ever. Do not be afraid of these nightmares/dreams, they are not real, but they sometimes can mean something.