In 1869 new rations of tinned mutton were introduced for British seamen. They were unimpressed by it, and decided it must be the butchered remains of X. The way her body had been strewn over a wide area presumably encouraged speculation that parts of her had been found at the Royal Navy victualling yard in Deptford, which was a large facility which included stores, a bakery and an abattoir.
"X" became slang for mutton or stew and then for anything worthless — from which comes the current use of "_____ X" to mean "nothing at all". It can be seen as a euphemism for "fuck all" – which means the same.
This is not the only example of Royal Navy slang relating to unpopular rations: even today, tins of steak and kidney pudding are known as "baby's head". The large tins the mutton was delivered in were reused as mess tins. Mess tins or cooking pots are still known as X.
Id the phrase.