In a lying position, the lower part of the body is compressed, hindering blood flow. This increases pressure on the nerve endings, leading to sharp pain. Additionally, saliva production slows down at night, reducing the washing away of pathogenic bacteria, leading to their more active development and intensified inflammation and pain.