Before a deadline was a date on a calendar, it was a place where you could be shot.
Merriam-Webster finds the word in the diaries of captured soldiers in 1863. Robert Ransom, a Union prisoner, wrote that November: "The ditch serves as a dead line, and no prisoners must go near the ditch."
The most notorious deadline was at Andersonville, a Confederate prison in Georgia that opened in early 1864. A Confederate inspector, Lieutenant Colonel D. T. Chandler, described it in a report quoted by Grammarphobia. "A railing around the inside of the stockade and about 20 feet from it constitutes the 'dead-line.'"
The orders behind it were blunt. Etymonline quotes instructions for guards to "fire upon and kill" any prisoner who touched, fell upon, or passed over or under the line. A Sanitary Commission bulletin of September 1864, quoted by Merriam-Webster, put it more vividly. Beyond that rail, "the projection of a foot or finger is sure to bring the deadly bullet of the sentinel." Merriam-Webster notes that use of the word jumped that year, in news reports and in poetry.
After the war the word loosened. Etymonline records a sense of an absolute limit in the late 1800s and early 1900s. It was used especially for the maximum age at which factories would hire, often 35. Printers had a "dead line" too. Grammarphobia describes it as a guideline marked on the bed of a printing press.
The modern meaning came out of newsrooms. Etymonline dates it to 1919 in American newspaper jargon: the absolute last minute when copy could be sent to the printer. Merriam-Webster's earliest example of the time sense is also from 1919. By the middle of the 20th century, that sense had crowded out the others.
How exactly the prison line became the newsroom one is not documented. The age-limit sense and the printing-press line may have been stepping stones. Etymonline is careful here, saying only that the modern word was "perhaps influenced" by the prison sense. What is certain is the order: the lethal line came first, by about half a century.
The parts of the word are plain English. "Dead" goes back to Old English. "Line" comes from Latin linea, a linen thread, which came to mean a mark, a boundary or a limit. At Andersonville, that boundary was drawn in wood.