I assume I’m not the only one to point this out, but why does the phrase “sleeping like a baby” still exist?

Does it refer to the crying in bed, or the stop-go nature of the sleep?  Or does it refer to the restless legs and shifting in bed?  Or maybe the inevitable waking with a wet diaper?

Help me out here.