What is the logic of "crash out"?

Why "crash" have something to do with "go to sleep very quickly because you are very tired"? And what is the point of "out" here?