system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How are people with dementia able to have "good days" when they remember people or events that they wouldn't normally recall?
gpt
Your brain is always getting information from the environment around you: what you hear people say, the color of the walls, what you see people do, the feeling of your clothes against your skin, what cards you have in your hand when playing a card game, and so on. Not all of that information is  important. When you're playing a card game with friends, knowing what cards you have and hearing when your friend says it's your turn is useful, but the fact that the wall is white isn't useful information. Luckily, there is a part of your brain that decides what information is important, and filters out the extra info so you can concentrate. 

In patients with dementia, that part of the brain has been damaged- it's not completely useless, but it's much weaker than it would be in a healthy person. Basically, these patients are overwhelmed with information, but they have trouble figuring out what information is important and what that information means. They may see white walls and think it means they are in their mother's house, or they may see the cards and realize they need to lay down an ace to win. 

There's no way to know for sure when they will pick up on the right information, but scientists do have some ideas of what causes them to be more aware. How aware (lucid) a person is can vary based on tiredness, mood, changes in physical health, what drugs/hormones are in their body, the environment around them, how other people are acting, etc.

For example, let's say Ruby is in the middle stages of dementia and normally isn't aware of where she is. Her in-home caregiver decides to take her on a car ride one morning and accidentally begins to back up too close to the edge of a drop off, and Ruby suddenly shouts, "If you don't pull forward we're gonna die!" This is likely because 1) it is morning and Ruby is not yet tired, meaning the part of her brain that is damaged is not yet worn out from a busy day of trying to make sense of things, and 2) this situation is especially dangerous, meaning that other parts of Ruby's brain would recognize that this is a threat and send out hormones that improves how well the damaged part of her brain works. 

In the same vein, being very tired or in a dull environment could cause a person to be less aware. 

Many experts believe that a lucid day (good day) happens when the "perfect storm" of these factors occur.