system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: Why do we get nightmares when we are feverish or sick and fall asleep?
gpt
Dreams are not fully understood, and neither are nightmares. Based on empirical findings there are several theories that present themselves. 

Based on those different theories there are different explanations and answers to your question, but our knowledge in this area and the brain as a whole is surprisingly limited.

Nightmares are defined as bad dreams. 

The most reasonable theory would be the Modern (Freudian) Theory:

Most people today subscribe to this theory that dreams are a connection to our unconscious mind ie. our hidden desires and true feelings.

Hence, when you are sick, the emotions generated in our unconscious mind correlate to those which have been proven to elicit nightmares, as dreams are a reflection of out strongest, most abstract emotions according to this theory.

Stress and discomfort cause bad dreams as a result. Nightmares due to being sick or going through a rough patch in life have the same cause.