Deep sleep sounds restful, but during it our brains are actually working hard. One of the main things the brain is doing is moving memories from short-term storage into long-term storage, allowing us more short-term memory space for the next day. If you don't get adequate deep sleep then these memories will be lost.
Yeah, if I drink any form of caffeine, this deep sleep is less effective. I can tell if I am on a caffeine binge working all the time, my days blur into one.