There are many idioms with "hang" in them. To hang has many meanings, but in the following terms, to hang means to lean or be suspended. These terms are used in surfing and sailing and have become common in every day usage.
This term, used in the ancient game of chess, derives from the Arabic, "Shah mat!" ( The king is dead), then Spanish, "xaque mate", then French, "eschec mat", then early English, "chek mate".