Recent research shows nightmares are more common with children, with a handful of those dreams remembered when the child grows into adulthood. About 50% of the adult population have nightmares on occasion, while only about 6% of us have intense nightmares on a regular basis.
This is an important place to explain the difference between nightmares and night terrors. Nightmares always occur in the rapid eye movement (REM) portion of sleep which is closest to when a person awakens. That explains why so many of us remember those scary dreams in vivid detail. Night terrors, on the other hand, happen in the first few hours after a person falls asleep. Many of us cannot recall the actual details of that scary experience. We just know that it was something horrible. Sleep studies show these night terrors can be the brain's way of dealing with a person's traumatic experiences in the past. And many of the sleep study participants revealed they had some degree of post-traumatic stress syndrome related to some incidents in their past.
As far as the more common nightmares are concerned, some people who had a sugary snack before bedtime reported "strange" nightmares. (What I call the "where did that come from" dream.) Since the sugar kick starts the body's metabolism, it signals the brain to become more active. Prescription meds can also have an affect.