Chess players are often told that checkmate means "the king is dead." It is a neat explanation, and it is probably the wrong one.
The word comes from the Persian phrase shah mat. Shah is the Persian word for a king, and it is also the source of "check": players announced it when the king was under attack. The trouble is the second word. If mat is the Arabic verb mata, "he died," then the phrase does mean "the king is dead." Chess reached Europe through the Arab world, which is why that reading took hold.
The Barnhart Etymological Dictionary, quoted by Wikipedia, takes mat as a Persian adjective meaning "at a loss," "helpless" or "defeated." Etymonline, also citing Barnhart, says it may be that Arabic speakers misread Persian mat, "astonished," as a form of "to die." On that account the phrase is closer to "the king is left helpless." Merriam-Webster glosses the Persian-derived mat as "left, at a loss, helpless."
Merriam-Webster calls the "died" reading a folk etymology and judges the Persian origin more plausible. Etymonline, by contrast, still lists the Arabic phrase meaning "the king died" as the source of the Old French. Wikipedia also lists a Sanskrit candidate, mata, and a proposal that mat comes from the Persian verb mandan, "to remain."
What is clear is the path west. Old French turned the phrase into eschec mat, which also gave Spanish jaque y mate and Italian scacco matto. Etymonline dates English "checkmate" to the mid-14th century, though Merriam-Webster's first known use of the noun is the 15th century. The same French eschec, in the plural, gave English "chess" itself in the 13th century.
The meaning of the move changed with the rules. According to Wikipedia, in early Sanskrit chess the king could be captured. The Persians added the warning of check and later a rule against moving into or leaving the king in check. Before about 1600 you could also win by capturing every enemy piece, leaving a bare king.
The figurative use is old too. Etymonline records "checkmate" as a verb meaning "to thwart" in the late 14th century, long before the chess sense of the verb in 1789.