"finished, worn out, dead," 1895 as a German word in English, from German kaputt "destroyed, ruined, lost" (1640s), which in this sense probably is a misunderstanding of an expression from card-playing, capot machen, a partial translation into German of French faire capot, a phrase which meant "to win all the tricks (from the other player) in piquet," an obsolete card game.
The French phrase means "to make a bonnet," and perhaps the notion is throwing a hood over the other player, but faire capot also meant in French marine jargon "to overset in a squall when under sail." The German word was popularized in English during World War I.
"Kaput" — a slang word in common use which corresponds roughly to the English "done in," the French "fichu." Everything enemy was "kaput" in the early days of German victories. [F. Britten Austin, "According to Orders," New York, 1919]
French capot is literally "cover, bonnet," also the name of a type of greatcloak worn by sailors and soldiers (see capote).
The card-playing sense is attested in German only from 1690s, but capot in the (presumably) transferred sense of "destroyed, ruined, lost" is attested from 1640s [see William Jervis Jones, "A Lexicon of French Borrowings in the German Vocabulary (1575-1648)," Berlin, de Gruyter, 1976]. In Hoyle and other English gaming sources, faire capot is "to win all the tricks," and a different phrase, être capot, literally "to be a bonnet," is sometimes cited as the term for losing them. The sense reversal in German might have come about because if someone wins all the tricks the other player has to lose them, and the same word capot, when it entered English from French in the mid-17c. meant "to score a capot against; to win all the tricks from," with figurative extensions, e.g.:
"There are others, says a third, that have played with my Lady Lurewell at picquet besides my lord; I have capotted her myself two or three times in an evening." [George Farquhar (1677-1707), "Sir Harry Wildair"]