Why insomnia affects your mental health

Why do we feel so low when we've not had enough sleep?