Don't take it literally! Else, your ear might hurt... It simply means "to take a nap" or "to go to sleep", in the sense that you lie down on your side (which implies that your head will rest on either one of your ears). Thus, "hauen" refers to your ear's hitting the pillow. :D