Sleep, like digestion, wound healing, or respiration, seems to be one of those complex bodily processes that can suffer from dysfunction for a variety of reasons we're only now beginning to understand rigorously. A quality polysomnography is a good place to start.