In the day, our brains are occupied with all the things that need to be done and tasks and people – all the distractions. Look at the red arrow – that is pointed towards your frontal cortex. That is the thinking part of the brain. Where you plan. Where you complete tasks.
At night, that part of the brain is less stimulated. Here it is in blue. The blue shows not much glucose is being used – glucose is the only energy source for the brain. (This brain is a brain of someone with PTSD but it sort of highlights what I’m trying to explain.)
At night the Limbic system is awake. This is the part of the brain responsible for controlling pain. Also sleep. And metabolism and blood pressure and all sorts of things. Now at night, this part of the brain is more active than the cortex.
Also, at night, if you lie there thinking and thinking and thinking (that’s anxiety) then the flight fright fight center (Limbic system) is stimulated. See the yellow? That is the area of pain and inflammation.

Obviously, it’s a bit more complicated than that. Everyone is different. General explanation. Have a look at this section to Lower Inflammation and pain.
Take care
Judy